本文整理汇总了Java中org.eclipse.ocl.pivot.values.SetValue.Accumulator方法的典型用法代码示例。如果您正苦于以下问题:Java SetValue.Accumulator方法的具体用法?Java SetValue.Accumulator怎么用?Java SetValue.Accumulator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ocl.pivot.values.SetValue
的用法示例。
在下文中一共展示了SetValue.Accumulator方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEntities
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Entity> getEntities() {
/**
* Entity.allInstances()->select(kind = self)
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_occi_c_c_Entity_0 = idResolver.getClass(OCCITables.CLSSid_Entity, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, OCCITables.SET_CLSSid_Entity, TYP_occi_c_c_Entity_0);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.SET_CLSSid_Entity);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
/*@NonInvalid*/ SetValue select;
while (true) {
if (!ITERATOR__1.hasNext()) {
select = accumulator;
break;
}
/*@NonInvalid*/ Entity _1 = (Entity)ITERATOR__1.next();
/**
* kind = self
*/
final /*@NonInvalid*/ Kind kind_0 = _1.getKind();
final /*@NonInvalid*/ boolean eq = kind_0.equals(this);
//
if (eq == ValueUtil.TRUE_VALUE) {
accumulator.add(_1);
}
}
final /*@NonInvalid*/ List<Entity> ECORE_select = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Entity.class, select);
return (EList<Entity>)ECORE_select;
}
示例2: IPAdressesMustBeUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean IPAdressesMustBeUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv IPAdressesMustBeUnique:
* let
* severity : Integer[1] = 'Ipnetworkinterface::IPAdressesMustBeUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let
* result : occi::Boolean[1] = Ipnetworkinterface.allInstances()
* ->isUnique(occiNetworkinterfaceAddress)
* in
* 'Ipnetworkinterface::IPAdressesMustBeUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, InfrastructureTables.STR_Ipnetworkinterface_c_c_IPAdressesMustBeUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, InfrastructureTables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_infrastructure_c_c_Ipnetworkinterface = idResolver.getClass(InfrastructureTables.CLSSid_Ipnetworkinterface, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, InfrastructureTables.SET_CLSSid_Ipnetworkinterface, TYP_infrastructure_c_c_Ipnetworkinterface);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(InfrastructureTables.SET_CLSSid_Ipnetworkinterface);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Ipnetworkinterface _1 = (Ipnetworkinterface)ITERATOR__1.next();
/**
* occiNetworkinterfaceAddress
*/
final /*@NonInvalid*/ String occiNetworkinterfaceAddress = _1.getOcciNetworkinterfaceAddress();
//
if (accumulator.includes(occiNetworkinterfaceAddress) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(occiNetworkinterfaceAddress);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, InfrastructureTables.STR_Ipnetworkinterface_c_c_IPAdressesMustBeUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, InfrastructureTables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例3: UniqueVlan
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean UniqueVlan(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv UniqueVlan:
* let severity : Integer[1] = 'Network::UniqueVlan'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let
* result : occi::Boolean[1] = Network.allInstances()
* ->isUnique(occiNetworkVlan)
* in
* 'Network::UniqueVlan'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, InfrastructureTables.STR_Network_c_c_UniqueVlan);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, InfrastructureTables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
/*@Caught*/ /*@NonNull*/ Object CAUGHT_result;
try {
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_infrastructure_c_c_Network = idResolver.getClass(InfrastructureTables.CLSSid_Network, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, InfrastructureTables.SET_CLSSid_Network, TYP_infrastructure_c_c_Network);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(InfrastructureTables.SET_CLSSid_Network);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
/*@Thrown*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Network _1 = (Network)ITERATOR__1.next();
/**
* occiNetworkVlan
*/
final /*@NonInvalid*/ Integer occiNetworkVlan = _1.getOcciNetworkVlan();
final /*@NonInvalid*/ IntegerValue BOXED_occiNetworkVlan = occiNetworkVlan == null ? null : ValueUtil.integerValueOf(occiNetworkVlan);
//
if (accumulator.includes(BOXED_occiNetworkVlan) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(BOXED_occiNetworkVlan);
}
}
CAUGHT_result = result;
}
catch (Exception e) {
CAUGHT_result = ValueUtil.createInvalidValue(e);
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, InfrastructureTables.STR_Network_c_c_UniqueVlan, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, InfrastructureTables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例4: AttributesNameUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean AttributesNameUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv AttributesNameUnique:
* let severity : Integer[1] = 'Category::AttributesNameUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let result : Boolean[1] = attributes->isUnique(name)
* in
* 'Category::AttributesNameUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Category_c_c_AttributesNameUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ List<Attribute> attributes = this.getAttributes();
final /*@NonInvalid*/ OrderedSetValue BOXED_attributes = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Attribute, attributes);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.ORD_CLSSid_Attribute);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = BOXED_attributes.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Attribute _1 = (Attribute)ITERATOR__1.next();
/**
* name
*/
final /*@NonInvalid*/ String name = _1.getName();
//
if (accumulator.includes(name) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(name);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Category_c_c_AttributesNameUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例5: IdentityUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean IdentityUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv IdentityUnique:
* let severity : Integer[1] = 'Category::IdentityUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let
* result : Boolean[1] = Category.allInstances()
* ->isUnique(scheme + term)
* in
* 'Category::IdentityUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Category_c_c_IdentityUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_occi_c_c_Category = idResolver.getClass(OCCITables.CLSSid_Category, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, OCCITables.SET_CLSSid_Category, TYP_occi_c_c_Category);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.SET_CLSSid_Category);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Category _1 = (Category)ITERATOR__1.next();
/**
* scheme + term
*/
final /*@NonInvalid*/ String scheme = _1.getScheme();
final /*@NonInvalid*/ String term = _1.getTerm();
final /*@NonInvalid*/ String sum = StringConcatOperation.INSTANCE.evaluate(scheme, term);
//
if (accumulator.includes(sum) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(sum);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Category_c_c_IdentityUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例6: AttributesNameUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean AttributesNameUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv AttributesNameUnique:
* let severity : Integer[1] = 'Entity::AttributesNameUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let result : Boolean[1] = attributes->isUnique(name)
* in
* 'Entity::AttributesNameUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Entity_c_c_AttributesNameUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ List<AttributeState> attributes = this.getAttributes();
final /*@NonInvalid*/ OrderedSetValue BOXED_attributes = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_AttributeState, attributes);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.ORD_CLSSid_AttributeState);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = BOXED_attributes.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ AttributeState _1 = (AttributeState)ITERATOR__1.next();
/**
* name
*/
final /*@NonInvalid*/ String name = _1.getName();
//
if (accumulator.includes(name) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(name);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Entity_c_c_AttributesNameUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例7: IdUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean IdUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv IdUnique:
* let severity : Integer[1] = 'Entity::IdUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let result : Boolean[1] = Entity.allInstances()->isUnique(id)
* in
* 'Entity::IdUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Entity_c_c_IdUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_occi_c_c_Entity_0 = idResolver.getClass(OCCITables.CLSSid_Entity, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, OCCITables.SET_CLSSid_Entity, TYP_occi_c_c_Entity_0);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.SET_CLSSid_Entity);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Entity _1 = (Entity)ITERATOR__1.next();
/**
* id
*/
final /*@NonInvalid*/ String id = _1.getId();
//
if (accumulator.includes(id) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(id);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Entity_c_c_IdUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例8: getEntities
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Entity> getEntities() {
/**
*
* Entity.allInstances()
* ->select(parts.mixin->includes(self))
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_occi_c_c_Entity_0 = idResolver.getClass(OCCITables.CLSSid_Entity, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, OCCITables.SET_CLSSid_Entity, TYP_occi_c_c_Entity_0);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.SET_CLSSid_Entity);
/*@NonNull*/ Iterator<Object> ITERATOR__1_0 = allInstances.iterator();
/*@NonInvalid*/ SetValue select;
while (true) {
if (!ITERATOR__1_0.hasNext()) {
select = accumulator;
break;
}
/*@NonInvalid*/ Entity _1_0 = (Entity)ITERATOR__1_0.next();
/**
* parts.mixin->includes(self)
*/
final /*@NonInvalid*/ List<MixinBase> parts = _1_0.getParts();
final /*@NonInvalid*/ OrderedSetValue BOXED_parts = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_MixinBase, parts);
/*@Thrown*/ SequenceValue.Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(OCCITables.SEQ_CLSSid_Mixin);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = BOXED_parts.iterator();
/*@NonInvalid*/ SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator_0;
break;
}
/*@NonInvalid*/ MixinBase _1 = (MixinBase)ITERATOR__1.next();
/**
* mixin
*/
final /*@NonInvalid*/ Mixin mixin = _1.getMixin();
//
accumulator_0.add(mixin);
}
final /*@NonInvalid*/ boolean includes = CollectionIncludesOperation.INSTANCE.evaluate(collect, this).booleanValue();
//
if (includes == ValueUtil.TRUE_VALUE) {
accumulator.add(_1_0);
}
}
final /*@NonInvalid*/ List<Entity> ECORE_select = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Entity.class, select);
return (EList<Entity>)ECORE_select;
}
示例9: ActionTermUnicity
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ActionTermUnicity(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv ActionTermUnicity:
* let severity : Integer[1] = 'Type::ActionTermUnicity'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let result : Boolean[1] = actions->isUnique(term)
* in
* 'Type::ActionTermUnicity'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Type_c_c_ActionTermUnicity);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ List<Action> actions = this.getActions();
final /*@NonInvalid*/ OrderedSetValue BOXED_actions = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Action, actions);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.ORD_CLSSid_Action);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = BOXED_actions.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Action _1 = (Action)ITERATOR__1.next();
/**
* term
*/
final /*@NonInvalid*/ String term = _1.getTerm();
//
if (accumulator.includes(term) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(term);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Type_c_c_ActionTermUnicity, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例10: ConstraintNameUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ConstraintNameUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv ConstraintNameUnique:
* let severity : Integer[1] = 'Type::ConstraintNameUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let result : Boolean[1] = constraints->isUnique(name)
* in
* 'Type::ConstraintNameUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Type_c_c_ConstraintNameUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ List<Constraint> constraints = this.getConstraints();
final /*@NonInvalid*/ OrderedSetValue BOXED_constraints = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Constraint, constraints);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.ORD_CLSSid_Constraint);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = BOXED_constraints.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Constraint _1 = (Constraint)ITERATOR__1.next();
/**
* name
*/
final /*@NonInvalid*/ String name = _1.getName();
//
if (accumulator.includes(name) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(name);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Type_c_c_ConstraintNameUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例11: SchemeUnique
import org.eclipse.ocl.pivot.values.SetValue; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean SchemeUnique(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv SchemeUnique:
* let severity : Integer[1] = 'Extension::SchemeUnique'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let
* result : Boolean[1] = Extension.allInstances()
* ->isUnique(scheme)
* in
* 'Extension::SchemeUnique'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
* endif
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_Extension_c_c_SchemeUnique);
final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
/*@NonInvalid*/ boolean symbol_0;
if (le) {
symbol_0 = ValueUtil.TRUE_VALUE;
}
else {
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_occi_c_c_Extension_0 = idResolver.getClass(OCCITables.CLSSid_Extension, null);
final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, OCCITables.SET_CLSSid_Extension, TYP_occi_c_c_Extension_0);
/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(OCCITables.SET_CLSSid_Extension);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
/*@NonInvalid*/ boolean result;
while (true) {
if (!ITERATOR__1.hasNext()) {
result = ValueUtil.TRUE_VALUE;
break;
}
/*@NonInvalid*/ Extension _1 = (Extension)ITERATOR__1.next();
/**
* scheme
*/
final /*@NonInvalid*/ String scheme = _1.getScheme();
//
if (accumulator.includes(scheme) == ValueUtil.TRUE_VALUE) {
result = ValueUtil.FALSE_VALUE; // Abort after second find
break;
}
else {
accumulator.add(scheme);
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Extension_c_c_SchemeUnique, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}