本文整理汇总了Java中org.eclipse.ocl.pivot.ids.IdResolver.createOrderedSetOfAll方法的典型用法代码示例。如果您正苦于以下问题:Java IdResolver.createOrderedSetOfAll方法的具体用法?Java IdResolver.createOrderedSetOfAll怎么用?Java IdResolver.createOrderedSetOfAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ocl.pivot.ids.IdResolver
的用法示例。
在下文中一共展示了IdResolver.createOrderedSetOfAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: basicEvaluate
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
@Override
public @Nullable Object basicEvaluate(@NonNull Executor executor, @NonNull TypedElement caller, @Nullable Object @NonNull [] sourceAndArgumentValues) {
@SuppressWarnings("null") final /*@NonInvalid*/ @NonNull CompilationUnit self_16 = (/*@NonInvalid*/ @NonNull CompilationUnit)sourceAndArgumentValues[0];
final /*@NonInvalid*/ @Nullable Visitable child = (/*@NonInvalid*/ @Nullable Visitable)sourceAndArgumentValues[1];
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_FunctionDefinition_0 = idResolver.getClass(CLSSid_FunctionDefinition, null);
final /*@Thrown*/ @NonNull LookupEnvironment self_27 = INSTANCE_Visitable_parentEnv_FunctionDefinition.evaluate(self_16);
final /*@NonInvalid*/ @NonNull Property CTORid_parentEnv = idResolver.getProperty(PROPid_parentEnv);
final /*@NonInvalid*/ [email protected] Class TYP_lookup_c_c_LookupEnvironment_0 = idResolver.getClass(CLSSid_LookupEnvironment, null);
final /*@Thrown*/ @NonNull LookupEnvironment symbol_0 = (LookupEnvironment)TYP_lookup_c_c_LookupEnvironment_0.createInstance();
CTORid_parentEnv.initValue(symbol_0, self_27);
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<DefinitionObject> fragments = self_16.getFragments();
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_fragments = idResolver.createOrderedSetOfAll(ORD_CLSSid_DefinitionObject, fragments);
final /*@Thrown*/ @NonNull OrderedSetValue selectByKind = (OrderedSetValue)CollectionSelectByKindOperation.INSTANCE.evaluate(executor, BOXED_fragments, TYP_astm_c_c_FunctionDefinition_0);
final /*@Thrown*/ @NonNull List<FunctionDefinition> ECORE_selectByKind = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(FunctionDefinition.class, selectByKind);
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull LookupEnvironment addElements = symbol_0.addElements(ECORE_selectByKind);
return addElements;
}
示例2: getMixins
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Mixin> getMixins() {
/**
* parts.mixin->asSet()
*/
final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ List<MixinBase> parts = this.getParts();
final /*@NonInvalid*/ OrderedSetValue BOXED_parts = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_MixinBase, parts);
/*@Thrown*/ SequenceValue.Accumulator accumulator = 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;
break;
}
/*@NonInvalid*/ MixinBase _1 = (MixinBase)ITERATOR__1.next();
/**
* mixin
*/
final /*@NonInvalid*/ Mixin mixin = _1.getMixin();
//
accumulator.add(mixin);
}
final /*@NonInvalid*/ SetValue asSet = CollectionAsSetOperation.INSTANCE.evaluate(collect);
final /*@NonInvalid*/ List<Mixin> ECORE_asSet = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Mixin.class, asSet);
return (EList<Mixin>)ECORE_asSet;
}
示例3: MAP_m_Visitable__ast_4
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
*
* map m_Visitable__ast_4 in Delphi_qvtp_qvtcas {
*
* guard:leftCS lMultipleConstExp : delphi::MultipleConstExp[1];
* var exps : OrderedSet(delphi::constExpr) := lMultipleConstExp.exps;
* var _'\u00ABcollect\u00BB' : Sequence(astm::Expression)[*|?] := exps->collect(_'1_' |
* _'1_'.ast.oclAsType(astm::Expression))
* ;
* var first : astm::Expression[?] := _'\u00ABcollect\u00BB'->first();
* set lMultipleConstExp.ast := first;
*
*/
protected boolean MAP_m_Visitable__ast_4(final /*@NonInvalid*/ @NonNull MultipleConstExp lMultipleConstExp) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<constExpr> exps = lMultipleConstExp.getExps();
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_exps = idResolver.createOrderedSetOfAll(ORD_CLSSid_constExpr, exps);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_Expression);
@NonNull Iterator<Object> ITERATOR__1 = BOXED_exps.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull constExpr _1 = (constExpr)ITERATOR__1.next();
/**
* _'1_'.ast.oclAsType(astm::Expression)
*/
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Expression_0 = idResolver.getClass(CLSSid_Expression, null);
final /*@Thrown*/ @Nullable Visitable ast = _1.getAst();
final /*@Thrown*/ @NonNull Expression oclAsType = ClassUtil.nonNullState((Expression)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_Expression_0));
//
accumulator.add(oclAsType);
}
final /*@Thrown*/ @Nullable Expression first = (Expression)OrderedCollectionFirstOperation.INSTANCE.evaluate(collect);
// mapping statements
lMultipleConstExp.setAst(first);
final /*@Thrown*/ @Nullable Boolean m_Visitable__ast_4 = ValueUtil.TRUE_VALUE;
return m_Visitable__ast_4;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_Visitable__ast_4", e);
}
}
示例4: AttributesNameUnique
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的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: containedAttribute
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean containedAttribute(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv containedAttribute:
* let severity : Integer[1] = 'FSM::containedAttribute'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let
* result : Boolean[1] = self.oclContainer()
* .oclAsType(Type)
* .attributes->includes(self.attribute)
* in
* 'FSM::containedAttribute'.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_FSM_c_c_containedAttribute);
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 {
/*@Caught*/ /*@NonNull*/ Object CAUGHT_result;
try {
final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_occi_c_c_Type = idResolver.getClass(OCCITables.CLSSid_Type, null);
final /*@NonInvalid*/ Object oclContainer = ClassifierOclContainerOperation.INSTANCE.evaluate(executor, this);
final /*@Thrown*/ Type oclAsType = ClassUtil.nonNullState((Type)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, oclContainer, TYP_occi_c_c_Type));
final /*@Thrown*/ List<Attribute> attributes = oclAsType.getAttributes();
final /*@Thrown*/ OrderedSetValue BOXED_attributes = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Attribute, attributes);
final /*@NonInvalid*/ Attribute attribute = this.getAttribute();
final /*@Thrown*/ boolean result = CollectionIncludesOperation.INSTANCE.evaluate(BOXED_attributes, attribute).booleanValue();
CAUGHT_result = result;
}
catch (Exception e) {
CAUGHT_result = ValueUtil.createInvalidValue(e);
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_FSM_c_c_containedAttribute, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例6: AttributesNameUnique
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的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: getEntities
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的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;
}
示例8: ActionTermUnicity
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的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;
}
示例9: ConstraintNameUnique
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的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;
}
示例10: KindsSchemeValid
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean KindsSchemeValid(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv KindsSchemeValid:
* let severity : Integer[1] = 'Extension::KindsSchemeValid'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let result : Boolean[?] = kinds->forAll(k | k.scheme = self.scheme)
* in
* 'Extension::KindsSchemeValid'.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_KindsSchemeValid);
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<Kind> kinds = this.getKinds();
final /*@NonInvalid*/ OrderedSetValue BOXED_kinds = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Kind, kinds);
/*@Thrown*/ Object accumulator = ValueUtil.TRUE_VALUE;
/*@NonNull*/ Iterator<Object> ITERATOR_k = BOXED_kinds.iterator();
/*@NonInvalid*/ Boolean result;
while (true) {
if (!ITERATOR_k.hasNext()) {
if (accumulator == ValueUtil.TRUE_VALUE) {
result = ValueUtil.TRUE_VALUE;
}
else {
throw (InvalidValueException)accumulator;
}
break;
}
/*@NonInvalid*/ Kind k = (Kind)ITERATOR_k.next();
/**
* k.scheme = self.scheme
*/
final /*@NonInvalid*/ String scheme = k.getScheme();
final /*@NonInvalid*/ String scheme_0 = this.getScheme();
final /*@NonInvalid*/ boolean eq = scheme.equals(scheme_0);
//
if (eq == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result
result = ValueUtil.FALSE_VALUE;
break; // Stop immediately
}
else if (eq == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result
; // Carry on
}
else { // Impossible badly typed result
accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll");
}
}
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Extension_c_c_KindsSchemeValid, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例11: TermUnicity
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean TermUnicity(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
/**
*
* inv TermUnicity:
* let severity : Integer[1] = 'Extension::TermUnicity'.getSeverity()
* in
* if severity <= 0
* then true
* else
* let
* result : Boolean[1] = kinds.term->intersection(mixins.term)
* ->isEmpty()
* in
* 'Extension::TermUnicity'.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_TermUnicity);
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<Kind> kinds = this.getKinds();
final /*@NonInvalid*/ OrderedSetValue BOXED_kinds = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Kind, kinds);
/*@Thrown*/ SequenceValue.Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(OCCITables.SEQ_PRIMid_String);
/*@NonNull*/ Iterator<Object> ITERATOR__1 = BOXED_kinds.iterator();
/*@NonInvalid*/ SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
/*@NonInvalid*/ Kind _1 = (Kind)ITERATOR__1.next();
/**
* term
*/
final /*@NonInvalid*/ String term = _1.getTerm();
//
accumulator.add(term);
}
final /*@NonInvalid*/ List<Mixin> mixins = this.getMixins();
final /*@NonInvalid*/ OrderedSetValue BOXED_mixins = idResolver.createOrderedSetOfAll(OCCITables.ORD_CLSSid_Mixin, mixins);
/*@Thrown*/ SequenceValue.Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(OCCITables.SEQ_PRIMid_String);
/*@NonNull*/ Iterator<Object> ITERATOR__1_0 = BOXED_mixins.iterator();
/*@NonInvalid*/ SequenceValue collect_0;
while (true) {
if (!ITERATOR__1_0.hasNext()) {
collect_0 = accumulator_0;
break;
}
/*@NonInvalid*/ Mixin _1_0 = (Mixin)ITERATOR__1_0.next();
/**
* term
*/
final /*@NonInvalid*/ String term_0 = _1_0.getTerm();
//
accumulator_0.add(term_0);
}
final /*@NonInvalid*/ BagValue intersection = (BagValue)CollectionIntersectionOperation.INSTANCE.evaluate(collect, collect_0);
final /*@NonInvalid*/ boolean result = CollectionIsEmptyOperation.INSTANCE.evaluate(intersection).booleanValue();
final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_Extension_c_c_TermUnicity, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
symbol_0 = logDiagnostic;
}
return Boolean.TRUE == symbol_0;
}
示例12: MAP_m_Visitable__ast
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
*
* map m_Visitable__ast in Delphi_qvtp_qvtcas {
*
* guard:leftCS lRecordConstExp : delphi::RecordConstExp[1];
* var exps : OrderedSet(delphi::recordConstExpr) := lRecordConstExp.exps;
* var _'\u00ABcollect\u00BB' : Sequence(delphi::constExpr)[*|?] := exps->collect(_'1_' | _'1_'.constExp)
* ;
* var _'\u00ABcollect\u00BB1' : Sequence(astm::Expression)[*|?] := _'\u00ABcollect\u00BB'->collect(_'1_' |
* _'1_'.ast.oclAsType(astm::Expression))
* ;
* var first : astm::Expression[?] := _'\u00ABcollect\u00BB1'->first();
* set lRecordConstExp.ast := first;
*
*/
protected boolean MAP_m_Visitable__ast(final /*@NonInvalid*/ @NonNull RecordConstExp lRecordConstExp) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<recordConstExpr> exps = lRecordConstExp.getExps();
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_exps = idResolver.createOrderedSetOfAll(ORD_CLSSid_recordConstExpr, exps);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_constExpr);
@NonNull Iterator<Object> ITERATOR__1 = BOXED_exps.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull recordConstExpr _1 = (recordConstExpr)ITERATOR__1.next();
/**
* _'1_'.constExp
*/
final /*@Thrown*/ @Nullable constExpr constExp = _1.getConstExp();
//
accumulator.add(constExp);
}
/*@Thrown*/ [email protected] Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_Expression);
@Nullable Iterator<Object> ITERATOR__1_0 = collect.iterator();
/*@Thrown*/ @NonNull SequenceValue collect_0;
while (true) {
if (!ITERATOR__1_0.hasNext()) {
collect_0 = accumulator_0;
break;
}
/*@NonInvalid*/ @Nullable constExpr _1_0 = (constExpr)ITERATOR__1_0.next();
/**
* _'1_'.ast.oclAsType(astm::Expression)
*/
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Expression_0 = idResolver.getClass(CLSSid_Expression, null);
if (_1_0 == null) {
throw throwNull(lRecordConstExp, "Null source for \'\'http://www.xtext.org/example/delphi/Delphi\'::CSTrace::ast\'");
}
final /*@Thrown*/ @Nullable Visitable ast = _1_0.getAst();
final /*@Thrown*/ @NonNull Expression oclAsType = ClassUtil.nonNullState((Expression)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_Expression_0));
//
accumulator_0.add(oclAsType);
}
final /*@Thrown*/ @Nullable Expression first = (Expression)OrderedCollectionFirstOperation.INSTANCE.evaluate(collect_0);
// mapping statements
lRecordConstExp.setAst(first);
final /*@Thrown*/ @Nullable Boolean m_Visitable__ast = ValueUtil.TRUE_VALUE;
return m_Visitable__ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_Visitable__ast", e);
}
}
示例13: MAP_m_OrderedSet__fragments
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
*
* map m_OrderedSet__fragments in Delphi_qvtp_qvtcas {
*
* guard:leftCS lImplementationSection : delphi::implementationSection[1];
* var ast : astm::Visitable[1] := lImplementationSection.ast;
* var declSect : OrderedSet(delphi::declSection) := lImplementationSection.declSect;
* var aDelphiImplementationSection : astm::DelphiImplementationSection[1] := ast.oclAsType(astm::DelphiImplementationSection)
* ;
* var _'\u00ABcollect\u00BB' : Sequence(astm::DefinitionObject) := declSect->collect(_'1_' |
* _'1_'.getFragments());
* set aDelphiImplementationSection.fragments := _'\u00ABcollect\u00BB';
*
*/
protected boolean MAP_m_OrderedSet__fragments(final /*@NonInvalid*/ @NonNull implementationSection lImplementationSection_0) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@Thrown*/ @Nullable Visitable ast = lImplementationSection_0.getAst();
final /*@Thrown*/ boolean symbol_0 = ast != null;
/*@Thrown*/ @Nullable Boolean raw_ast;
if (symbol_0) {
if (ast == null) {
throw throwNull(lImplementationSection_0, "Null where non-null value required");
}
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<declSection> declSect = lImplementationSection_0.getDeclSect();
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_DelphiImplementationSection_0 = idResolver.getClass(CLSSid_DelphiImplementationSection, null);
final /*@Thrown*/ @NonNull DelphiImplementationSection oclAsType = ClassUtil.nonNullState((DelphiImplementationSection)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_DelphiImplementationSection_0));
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_declSect = idResolver.createOrderedSetOfAll(ORD_CLSSid_declSection, declSect);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_DefinitionObject);
@NonNull Iterator<Object> ITERATOR__1 = BOXED_declSect.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull declSection _1 = (declSection)ITERATOR__1.next();
/**
* _'1_'.getFragments()
*/
final /*@Thrown*/ @NonNull SequenceValue getFragments = INSTANCE_declSection_getFragments.evaluate(_1);
//
for (Object value : getFragments.flatten().getElements()) {
accumulator.add(value);
}
}
// mapping statements
final /*@Thrown*/ @NonNull List<DefinitionObject> ECORE_collect = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(DefinitionObject.class, collect);
oclAsType.getFragments().addAll(ECORE_collect);
final /*@Thrown*/ @Nullable Boolean m_OrderedSet__fragments = ValueUtil.TRUE_VALUE;
raw_ast = m_OrderedSet__fragments;
}
else {
raw_ast = ValueUtil.FALSE_VALUE;
}
return raw_ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_OrderedSet__fragments", e);
}
}
示例14: MAP_m_OrderedSet__fragments_1
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
*
* map m_OrderedSet__fragments_1 in Delphi_qvtp_qvtcas {
*
* guard:leftCS lInterfaceSection : delphi::interfaceSection[1];
* var ast : astm::Visitable[1] := lInterfaceSection.ast;
* var interfaceDecl1 : OrderedSet(delphi::interfaceDecl) := lInterfaceSection.interfaceDecl;
* var aDelphiInterfaceSection : astm::DelphiInterfaceSection[1] := ast.oclAsType(astm::DelphiInterfaceSection)
* ;
* var _'\u00ABcollect\u00BB' : Sequence(astm::DefinitionObject) := interfaceDecl1->collect(_'1_' |
* _'1_'.getFragments());
* set aDelphiInterfaceSection.fragments := _'\u00ABcollect\u00BB';
*
*/
protected boolean MAP_m_OrderedSet__fragments_1(final /*@NonInvalid*/ @NonNull interfaceSection lInterfaceSection_0) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@Thrown*/ @Nullable Visitable ast = lInterfaceSection_0.getAst();
final /*@Thrown*/ boolean symbol_0 = ast != null;
/*@Thrown*/ @Nullable Boolean raw_ast;
if (symbol_0) {
if (ast == null) {
throw throwNull(lInterfaceSection_0, "Null where non-null value required");
}
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<interfaceDecl> interfaceDecl = lInterfaceSection_0.getInterfaceDecl();
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_DelphiInterfaceSection_0 = idResolver.getClass(CLSSid_DelphiInterfaceSection, null);
final /*@Thrown*/ @NonNull DelphiInterfaceSection oclAsType = ClassUtil.nonNullState((DelphiInterfaceSection)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_DelphiInterfaceSection_0));
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_interfaceDecl = idResolver.createOrderedSetOfAll(ORD_CLSSid_interfaceDecl, interfaceDecl);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_DefinitionObject);
@NonNull Iterator<Object> ITERATOR__1 = BOXED_interfaceDecl.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull interfaceDecl _1 = (interfaceDecl)ITERATOR__1.next();
/**
* _'1_'.getFragments()
*/
final /*@Thrown*/ @NonNull SequenceValue getFragments = INSTANCE_interfaceDecl_getFragments.evaluate(_1);
//
for (Object value : getFragments.flatten().getElements()) {
accumulator.add(value);
}
}
// mapping statements
final /*@Thrown*/ @NonNull List<DefinitionObject> ECORE_collect = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(DefinitionObject.class, collect);
oclAsType.getFragments().addAll(ECORE_collect);
final /*@Thrown*/ @Nullable Boolean m_OrderedSet__fragments_1 = ValueUtil.TRUE_VALUE;
raw_ast = m_OrderedSet__fragments_1;
}
else {
raw_ast = ValueUtil.FALSE_VALUE;
}
return raw_ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_OrderedSet__fragments_1", e);
}
}
示例15: MAP_m_Visitable__subStatements_1
import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
*
* map m_Visitable__subStatements_1 in Delphi_qvtp_qvtcas {
*
* guard:leftCS lCompoundStmt : delphi::compoundStmt[1];
* var ast : astm::Visitable[1] := lCompoundStmt.ast;
* var stamtList : delphi::stmtList[?] := lCompoundStmt.stamtList;
* var aBlockStatement : astm::BlockStatement[1] := ast.oclAsType(astm::BlockStatement)
* ;
* var statments : OrderedSet(delphi::statement) := stamtList.statments;
* var _'\u00ABcollect\u00BB' : Sequence(astm::Statement)[*|?] := statments->collect(_'1_' |
* _'1_'.ast.oclAsType(astm::Statement));
* set aBlockStatement.subStatements := _'\u00ABcollect\u00BB';
*
*/
protected boolean MAP_m_Visitable__subStatements_1(final /*@NonInvalid*/ @NonNull compoundStmt lCompoundStmt_0) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@Thrown*/ @Nullable Visitable ast = lCompoundStmt_0.getAst();
final /*@Thrown*/ boolean symbol_0 = ast != null;
/*@Thrown*/ @Nullable Boolean raw_ast;
if (symbol_0) {
if (ast == null) {
throw throwNull(lCompoundStmt_0, "Null where non-null value required");
}
final /*@Thrown*/ @Nullable stmtList stamtList = lCompoundStmt_0.getStamtList();
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_BlockStatement_0 = idResolver.getClass(CLSSid_BlockStatement, null);
final /*@Thrown*/ @NonNull BlockStatement oclAsType = ClassUtil.nonNullState((BlockStatement)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_BlockStatement_0));
if (stamtList == null) {
throw throwNull(lCompoundStmt_0, "Null source for \'\'http://www.xtext.org/example/delphi/Delphi\'::stmtList::statments\'");
}
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<statement> statments = stamtList.getStatments();
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_statments = idResolver.createOrderedSetOfAll(ORD_CLSSid_statement, statments);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_Statement);
@NonNull Iterator<Object> ITERATOR__1 = BOXED_statments.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull statement _1 = (statement)ITERATOR__1.next();
/**
* _'1_'.ast.oclAsType(astm::Statement)
*/
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Statement_0 = idResolver.getClass(CLSSid_Statement, null);
final /*@Thrown*/ @Nullable Visitable ast_0 = _1.getAst();
final /*@Thrown*/ @NonNull Statement oclAsType_0 = ClassUtil.nonNullState((Statement)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_0, TYP_astm_c_c_Statement_0));
//
accumulator.add(oclAsType_0);
}
// mapping statements
final /*@Thrown*/ @NonNull List<Statement> ECORE_collect = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Statement.class, collect);
oclAsType.getSubStatements().addAll(ECORE_collect);
final /*@Thrown*/ @Nullable Boolean m_Visitable__subStatements_1 = ValueUtil.TRUE_VALUE;
raw_ast = m_Visitable__subStatements_1;
}
else {
raw_ast = ValueUtil.FALSE_VALUE;
}
return raw_ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_Visitable__subStatements_1", e);
}
}