本文整理汇总了Java中org.eclipse.ocl.pivot.utilities.ValueUtil.createSequenceAccumulatorValue方法的典型用法代码示例。如果您正苦于以下问题:Java ValueUtil.createSequenceAccumulatorValue方法的具体用法?Java ValueUtil.createSequenceAccumulatorValue怎么用?Java ValueUtil.createSequenceAccumulatorValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ocl.pivot.utilities.ValueUtil
的用法示例。
在下文中一共展示了ValueUtil.createSequenceAccumulatorValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMixins
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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;
}
示例2: basicEvaluate
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
@Override
public @Nullable Object basicEvaluate(@NonNull Executor executor, @NonNull TypedElement caller, @Nullable Object @NonNull [] sourceAndArgumentValues) {
@SuppressWarnings("null") final /*@NonInvalid*/ @NonNull exprList self_12 = (/*@NonInvalid*/ @NonNull exprList)sourceAndArgumentValues[0];
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<expression> exps = self_12.getExps();
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_exps = idResolver.createOrderedSetOfAll(ORD_CLSSid_expression, exps);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_ActualParameterExpression);
@NonNull Iterator<Object> ITERATOR_x = BOXED_exps.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR_x.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull expression x = (expression)ITERATOR_x.next();
/**
*
* astm::ActualParameterExpression{
* value = x.ast.oclAsType(astm::Expression)
* }
*/
final /*@NonInvalid*/ @NonNull Property CTORid_value = idResolver.getProperty(PROPid_value_0);
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_ActualParameterExpression_0 = idResolver.getClass(CLSSid_ActualParameterExpression, null);
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Expression_0 = idResolver.getClass(CLSSid_Expression, null);
final /*@Thrown*/ @NonNull ActualParameterExpression symbol_0 = (ActualParameterExpression)TYP_astm_c_c_ActualParameterExpression_0.createInstance();
final /*@Thrown*/ @Nullable Visitable ast = x.getAst();
final /*@Thrown*/ @NonNull Expression oclAsType = ClassUtil.nonNullState((Expression)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_Expression_0));
CTORid_value.initValue(symbol_0, oclAsType);
//
accumulator.add(symbol_0);
}
return collect;
}
示例3: MAP_m_Visitable__ast_4
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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: getEntities
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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;
}
示例5: TermUnicity
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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;
}
示例6: MAP_m_Visitable__ast
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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);
}
}
示例7: MAP_m_OrderedSet__declarations
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
/**
*
* map m_OrderedSet__declarations in Delphi_qvtp_qvtcas {
*
* guard:leftCS lBlock : delphi::block[1];
* var ast : astm::Visitable[1] := lBlock.ast;
* var declSect : delphi::declSection[?] := lBlock.declSect;
* var aDelphiBlockStatement : astm::DelphiBlockStatement[1] := ast.oclAsType(astm::DelphiBlockStatement)
* ;
* var oclAsSet : Set(delphi::declSection) := declSect.oclAsSet()
* ;
* var asSequence : Sequence(delphi::declSection) := oclAsSet->asSequence()
* ;
* var _'\u00ABcollect\u00BB' : Sequence(astm::DefinitionObject) := asSequence->collect(_'1_' |
* _'1_'.getFragments())
* ;
* var excluding : Collection(astm::DefinitionObject)[*|?] := _'\u00ABcollect\u00BB'->excluding(null);
* set aDelphiBlockStatement.declarations := excluding;
*
*/
protected boolean MAP_m_OrderedSet__declarations(final /*@NonInvalid*/ @NonNull block lBlock_0) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@Thrown*/ @Nullable Visitable ast = lBlock_0.getAst();
final /*@Thrown*/ boolean symbol_0 = ast != null;
/*@Thrown*/ @Nullable Boolean raw_ast;
if (symbol_0) {
if (ast == null) {
throw throwNull(lBlock_0, "Null where non-null value required");
}
final /*@Thrown*/ @Nullable declSection declSect = lBlock_0.getDeclSect();
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_DelphiBlockStatement_0 = idResolver.getClass(CLSSid_DelphiBlockStatement, null);
final /*@Thrown*/ @NonNull DelphiBlockStatement oclAsType = ClassUtil.nonNullState((DelphiBlockStatement)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_DelphiBlockStatement_0));
final /*@Thrown*/ @NonNull SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, SET_CLSSid_declSection, declSect);
final /*@Thrown*/ @NonNull SequenceValue asSequence = CollectionAsSequenceOperation.INSTANCE.evaluate(oclAsSet);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_DefinitionObject);
@NonNull Iterator<Object> ITERATOR__1 = asSequence.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);
}
}
final /*@Thrown*/ @NonNull CollectionValue excluding = CollectionExcludingOperation.INSTANCE.evaluate(collect, (Object)null);
// mapping statements
final /*@Thrown*/ @NonNull List<DefinitionObject> ECORE_excluding = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(DefinitionObject.class, excluding);
oclAsType.getDeclarations().addAll(ECORE_excluding);
final /*@Thrown*/ @Nullable Boolean m_OrderedSet__declarations = ValueUtil.TRUE_VALUE;
raw_ast = m_OrderedSet__declarations;
}
else {
raw_ast = ValueUtil.FALSE_VALUE;
}
return raw_ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_OrderedSet__declarations", e);
}
}
示例8: MAP_m_OrderedSet__fragments
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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);
}
}
示例9: MAP_m_OrderedSet__fragments_1
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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);
}
}
示例10: MAP_m_Visitable__subStatements_1
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的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);
}
}
示例11: MAP_m_Visitable__caseExpressions
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
/**
*
* map m_Visitable__caseExpressions in Delphi_qvtp_qvtcas {
*
* guard:leftCS lCaseSelector : delphi::caseSelector[1];
* var ast : astm::Visitable[1] := lCaseSelector.ast;
* var labels : OrderedSet(delphi::caseLabel) := lCaseSelector.labels;
* var aCaseBlock : astm::CaseBlock[1] := ast.oclAsType(astm::CaseBlock)
* ;
* var _'\u00ABcollect\u00BB' : Sequence(astm::Expression)[*|?] := labels->collect(x |
* x.first.ast.oclAsType(astm::Expression)
* .oclAsSet()
* ->including(x.last.ast.oclAsType(astm::Expression)));
* set aCaseBlock.caseExpressions := _'\u00ABcollect\u00BB';
*
*/
protected boolean MAP_m_Visitable__caseExpressions(final /*@NonInvalid*/ @NonNull caseSelector lCaseSelector_1) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@Thrown*/ @Nullable Visitable ast = lCaseSelector_1.getAst();
final /*@Thrown*/ boolean symbol_0 = ast != null;
/*@Thrown*/ @Nullable Boolean raw_ast;
if (symbol_0) {
if (ast == null) {
throw throwNull(lCaseSelector_1, "Null where non-null value required");
}
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<caseLabel> labels = lCaseSelector_1.getLabels();
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_CaseBlock_0 = idResolver.getClass(CLSSid_CaseBlock, null);
final /*@Thrown*/ @NonNull CaseBlock oclAsType = ClassUtil.nonNullState((CaseBlock)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_CaseBlock_0));
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_labels = idResolver.createOrderedSetOfAll(ORD_CLSSid_caseLabel, labels);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_Expression);
@NonNull Iterator<Object> ITERATOR_x = BOXED_labels.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR_x.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull caseLabel x = (caseLabel)ITERATOR_x.next();
/**
*
* x.first.ast.oclAsType(astm::Expression)
* .oclAsSet()
* ->including(x.last.ast.oclAsType(astm::Expression))
*/
final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Expression_1 = idResolver.getClass(CLSSid_Expression, null);
final /*@Thrown*/ @Nullable constExpr first = x.getFirst();
if (first == null) {
throw throwNull(lCaseSelector_1, "Null source for \'\'http://www.xtext.org/example/delphi/Delphi\'::CSTrace::ast\'");
}
final /*@Thrown*/ @Nullable Visitable ast_0 = first.getAst();
final /*@Thrown*/ @NonNull Expression oclAsType_0 = ClassUtil.nonNullState((Expression)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_0, TYP_astm_c_c_Expression_1));
final /*@Thrown*/ @NonNull SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, SET_CLSSid_Expression, oclAsType_0);
final /*@Thrown*/ @Nullable constExpr last = x.getLast();
if (last == null) {
throw throwNull(lCaseSelector_1, "Null source for \'\'http://www.xtext.org/example/delphi/Delphi\'::CSTrace::ast\'");
}
final /*@Thrown*/ @Nullable Visitable ast_1 = last.getAst();
final /*@Thrown*/ @NonNull Expression oclAsType_1 = ClassUtil.nonNullState((Expression)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_1, TYP_astm_c_c_Expression_1));
final /*@Thrown*/ @NonNull SetValue including = (SetValue)CollectionIncludingOperation.INSTANCE.evaluate(oclAsSet, oclAsType_1);
//
for (Object value : including.flatten().getElements()) {
accumulator.add(value);
}
}
// mapping statements
final /*@Thrown*/ @NonNull List<Expression> ECORE_collect = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Expression.class, collect);
oclAsType.getCaseExpressions().addAll(ECORE_collect);
final /*@Thrown*/ @Nullable Boolean m_Visitable__caseExpressions = ValueUtil.TRUE_VALUE;
raw_ast = m_Visitable__caseExpressions;
}
else {
raw_ast = ValueUtil.FALSE_VALUE;
}
return raw_ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_Visitable__caseExpressions", e);
}
}
示例12: MAP_m_Visitable__depts
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
/**
*
* map m_Visitable__depts in companies_qvtp_qvtcas {
*
* guard:leftCS lCompany : companies::company[1];
* var ast : company::Visitable[1] := lCompany.ast;
* var deparment : OrderedSet(companies::department) := lCompany.deparment;
* var aCompany : company::Company[1] := ast.oclAsType(company::Company)
* ;
* var _'\u00ABcollect\u00BB' : Sequence(company::Department)[*|?] := deparment->collect(_'1_' |
* _'1_'.ast.oclAsType(company::Department));
* set aCompany.depts := _'\u00ABcollect\u00BB';
*
*/
protected boolean MAP_m_Visitable__depts(final /*@NonInvalid*/ @NonNull company lCompany_0) {
try {
final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
final /*@Thrown*/ @Nullable Visitable ast = lCompany_0.getAst();
final /*@Thrown*/ boolean symbol_0 = ast != null;
/*@Thrown*/ @Nullable Boolean raw_ast;
if (symbol_0) {
if (ast == null) {
throw throwNull(lCompany_0, "Null where non-null value required");
}
@SuppressWarnings("null")
final /*@Thrown*/ @NonNull List<department> deparment = lCompany_0.getDeparment();
final /*@NonInvalid*/ [email protected] Class TYP_company_c_c_Company_0 = idResolver.getClass(CLSSid_Company, null);
final /*@Thrown*/ @NonNull Company oclAsType = ClassUtil.nonNullState((Company)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_company_c_c_Company_0));
final /*@Thrown*/ @NonNull OrderedSetValue BOXED_deparment = idResolver.createOrderedSetOfAll(ORD_CLSSid_department, deparment);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_Department);
@NonNull Iterator<Object> ITERATOR__1 = BOXED_deparment.iterator();
/*@Thrown*/ @NonNull SequenceValue collect;
while (true) {
if (!ITERATOR__1.hasNext()) {
collect = accumulator;
break;
}
@SuppressWarnings("null")
/*@NonInvalid*/ @NonNull department _1 = (department)ITERATOR__1.next();
/**
* _'1_'.ast.oclAsType(company::Department)
*/
final /*@NonInvalid*/ [email protected] Class TYP_company_c_c_Department_0 = idResolver.getClass(CLSSid_Department, null);
final /*@Thrown*/ @Nullable Visitable ast_0 = _1.getAst();
final /*@Thrown*/ @NonNull Department oclAsType_0 = ClassUtil.nonNullState((Department)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_0, TYP_company_c_c_Department_0));
//
accumulator.add(oclAsType_0);
}
// mapping statements
final /*@Thrown*/ @NonNull List<Department> ECORE_collect = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Department.class, collect);
oclAsType.getDepts().addAll(ECORE_collect);
final /*@Thrown*/ @Nullable Boolean m_Visitable__depts = ValueUtil.TRUE_VALUE;
raw_ast = m_Visitable__depts;
}
else {
raw_ast = ValueUtil.FALSE_VALUE;
}
return raw_ast;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_Visitable__depts", e);
}
}
示例13: MAP_m_SRoot_ast_ownedX
import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
/**
*
* map m_SRoot_ast_ownedX in Source2Target_qvtp_qvtcas {
* leftCS (lSRoot : source::SRoot[?];
* |)
* { |}
* rightAS ( |)
* { |}
* where ( |)
* {aTRoot : target::TRoot[1] = lSRoot.ast.oclAsType(target::TRoot)
* ;
* ast : ecore::EObject[?] = lSRoot.ast;
* ownedX : OrderedSet(source::X) = lSRoot.ownedX;
* _'\u00ABcollect\u00BB' : Sequence(target::A) = ownedX->collect(_'1_' |
* _'1_'.ast.oclAsType(target::A));
* |
* aTRoot.ownedA := _'\u00ABcollect\u00BB';
* }
*
*/
protected boolean MAP_m_SRoot_ast_ownedX(final /*@NonInvalid*/ [email protected].NonNull SRoot lSRoot_0) throws ReflectiveOperationException {
try {
// predicates and unrealized variables
final /*@NonInvalid*/ [email protected] IdResolver idResolver = executor.getIdResolver();
final /*@NonInvalid*/ [email protected] Class TYP_target_c_c_TRoot_0 = idResolver.getClass(CLSSid_TRoot, null);
final /*@Thrown*/ [email protected] EObject ast = lSRoot_0.getAst();
final /*@Thrown*/ [email protected].NonNull TRoot aTRoot = ClassUtil.nonNullState((TRoot)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_target_c_c_TRoot_0));
final /*@Thrown*/ [email protected] EObject ast_0 = lSRoot_0.getAst();
@SuppressWarnings("null")
final /*@Thrown*/ [email protected] List<X> ownedX = lSRoot_0.getOwnedX();
final /*@Thrown*/ [email protected] OrderedSetValue BOXED_ownedX = idResolver.createOrderedSetOfAll(ORD_CLSSid_X, ownedX);
/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(SEQ_CLSSid_A);
@Nullable Iterator<Object> ITERATOR__1 = BOXED_ownedX.iterator();
/*@Thrown*/ [email protected] SequenceValue _171_collect_187;
while (true) {
if (!ITERATOR__1.hasNext()) {
_171_collect_187 = accumulator;
break;
}
/*@NonInvalid*/ [email protected].Nullable X _1 = (X)ITERATOR__1.next();
/**
* _'1_'.ast.oclAsType(target::A)
*/
final /*@NonInvalid*/ [email protected] Class TYP_target_c_c_A_0 = idResolver.getClass(CLSSid_A, null);
if (_1 == null) {
throw throwNull(lSRoot_0, "Null source for \'\'http://uk.ac.york.cs.asbh.lang.cs2as/sourceMM/1.0\'::SElement::ast\'");
}
final /*@Thrown*/ [email protected] EObject ast_1 = _1.getAst();
final /*@Thrown*/ [email protected].NonNull A oclAsType = ClassUtil.nonNullState((A)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_1, TYP_target_c_c_A_0));
//
accumulator.add(oclAsType);
}
// property assignments
final /*@Thrown*/ [email protected] List<A> ECORE__171_collect_187 = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(A.class, _171_collect_187);
aTRoot.getOwnedA().addAll(ECORE__171_collect_187);
boolean m_SRoot_ast_ownedX = ValueUtil.TRUE_VALUE;
return m_SRoot_ast_ownedX;
} catch (Throwable e) {
return handleExecutionFailure("MAP_m_SRoot_ast_ownedX", e);
}
}