本文整理汇总了Java中org.eclipse.emf.common.util.EList.get方法的典型用法代码示例。如果您正苦于以下问题:Java EList.get方法的具体用法?Java EList.get怎么用?Java EList.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.common.util.EList
的用法示例。
在下文中一共展示了EList.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeMultiTextItems
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeMultiTextItems(final Question question) {
this.multiTextItems.clear();
EList _multiTextItems = question.getMultiTextItems();
int size = _multiTextItems.size();
int i = 0;
boolean _while = (i < size);
while (_while) {
{
EList _multiTextItems_1 = question.getMultiTextItems();
Object _get = _multiTextItems_1.get(i);
this.multiTextItems.add(((MultiTextItem) _get));
i = (i + 1);
}
_while = (i < size);
}
}
示例2: testDescriptionWithInline
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@SuppressWarnings("javadoc")
@Test
public void testDescriptionWithInline() {
String in = "/** This is the description with {@inline tag description} ..and finish description. \n */";
AbstractInlineTagDefinition inlineTag = new StubInlineTagDefinition("inline");
DocletParser docletParser = new DocletParser(null, new TagDictionary<>(Arrays.asList(inlineTag)));
Doclet doclet = docletParser.parse(in);
EList<ContentNode> contents = doclet.getContents();
Composite composite = (Composite) contents.get(0);
ContentNode node0 = composite.getContents().get(0);
ContentNode node1 = composite.getContents().get(1);
ContentNode node2 = composite.getContents().get(2);
Text descriptionText1 = (Text) node0;
InlineTag descriptionInlineTag = (InlineTag) node1;
Text descriptionText2 = (Text) node2;
assertEquals("This is the description with ", descriptionText1.getText());
assertEquals(" ..and finish description.", descriptionText2.getText());
TagValue inlineDescription = descriptionInlineTag.getValueByKey(StubInlineTagDefinition.PARAM_VALUE);
Text tValue = (Text) inlineDescription.getContents().get(0);
assertEquals(" tag description", tValue.getText());
}
示例3: initializeRows
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeRows(final Question question) {
this.rows.clear();
EList _matrixRows = question.getMatrixRows();
int size = _matrixRows.size();
int i = 0;
boolean _while = (i < size);
while (_while) {
{
EList _matrixRows_1 = question.getMatrixRows();
Object _get = _matrixRows_1.get(i);
this.rows.add(((TextValue) _get));
i = (i + 1);
}
_while = (i < size);
}
}
示例4: initializeQuestions
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeQuestions(final Page page) {
this.questions.clear();
EList _questions = page.getQuestions();
int size = _questions.size();
int i = 0;
boolean _while = (i < size);
while (_while) {
{
EList _questions_1 = page.getQuestions();
Object _get = _questions_1.get(i);
this.questions.add(((Question) _get));
i = (i + 1);
}
_while = (i < size);
}
}
示例5: testParserResumesAfterUnkonwLineTag
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@SuppressWarnings("javadoc")
@Test
public void testParserResumesAfterUnkonwLineTag() {
String in = "/** \n * @unkonwLineTag \n * @stubLineTagTitle1 \n * @stubLineTagTitle2 \n */";
AbstractLineTagDefinition tag0 = new StubLineTagDefinition("stubLineTagTitle0");
AbstractLineTagDefinition tag1 = new StubLineTagDefinition("stubLineTagTitle1");
AbstractLineTagDefinition tag2 = new StubLineTagDefinition("stubLineTagTitle2");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tag0, tag1, tag2)),
new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
EList<LineTag> lineTags = doclet.getLineTags();
assertEquals(2, lineTags.size());
// assuming that list is as parsing order
LineTag lineTag1 = lineTags.get(0);
assertEquals("stubLineTagTitle1", lineTag1.getTitle().getTitle());
LineTag lineTag2 = lineTags.get(1);
assertEquals("stubLineTagTitle2", lineTag2.getTitle().getTitle());
}
示例6: test_fullRef_simpleName
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@SuppressWarnings("javadoc")
@Test
public void test_fullRef_simpleName() {
String in = "/** foo."
+ "\n * @testee n4/model/collections/DataSet.DataSet.each"
+ "\n */";
AbstractLineTagDefinition tagDef = new LineTagWithFullMemberReference("testee");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tagDef)),
new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
EList<ContentNode> contents = lineTag.getValueByKey(LineTagWithFullElementReference.REF)
.getContents();
FullMemberReference ref = (FullMemberReference) contents.get(0);
assertEquals("n4/model/collections/DataSet", ref.getModuleName());
assertEquals("DataSet", ref.getTypeName());
assertEquals("each", ref.getMemberName());
}
示例7: test_fullRef_symbolName
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@SuppressWarnings("javadoc")
@Test
public void test_fullRef_symbolName() {
String in = "/** foo."
+ "\n * @testee n4/model/collections/DataSet.DataSet.#iterator"
+ "\n */";
AbstractLineTagDefinition tagDef = new LineTagWithFullMemberReference("testee");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tagDef)),
new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
EList<ContentNode> contents = lineTag.getValueByKey(LineTagWithFullElementReference.REF)
.getContents();
FullMemberReference ref = (FullMemberReference) contents.get(0);
assertEquals("n4/model/collections/DataSet", ref.getModuleName());
assertEquals("DataSet", ref.getTypeName());
assertEquals("#iterator", ref.getMemberName());
}
示例8: findPrecedingStatement
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private ControlFlowElement findPrecedingStatement(ControlFlowElement cfe) {
ControlFlowElement precedingStatement = null;
Statement stmt = EcoreUtil2.getContainerOfType(cfe, Statement.class);
if (stmt != null) {
EObject stmtContainer = stmt.eContainer();
if (stmtContainer != null && stmtContainer instanceof Block) {
Block block = (Block) stmtContainer;
EList<Statement> stmts = block.getStatements();
int index = stmts.indexOf(stmt);
if (index > 0) {
precedingStatement = stmts.get(index - 1);
}
}
}
return precedingStatement;
}
示例9: getSourcesOfMarkerAtRelations
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
/**
* This method is used to get source marker list of iMarker. Also iMarker doesn't contain any
* marker type.
*
* @param iMarker
* @return
*/
public static ArrayList<IMarker> getSourcesOfMarkerAtRelations(IMarker iMarker) {
iMarker = MarkUtilities.getLeaderOfMarker(iMarker);
final ArrayList<IMarker> sources = new ArrayList<>();
final DocumentRoot documentRoot = AlloyUtilities.getDocumentRoot();
final RelationType relationType = AlloyUtilities.getRelationType(documentRoot);
final String selectedMarkerId = MarkUtilities.getSourceId(iMarker);
final EList<TupleType> tupleTypes = relationType.getTuple();
for (final TupleType tupleType : tupleTypes) {
final EList<AtomType> atoms = tupleType.getAtom();
final AtomType firstAtomType = atoms.get(0);
final AtomType secondAtomType = atoms.get(1);
if (secondAtomType.getLabel().equals(selectedMarkerId)) {
final ItemType itemTypeOfAtom = AlloyUtilities.getItemById(firstAtomType.getLabel());
final IMarker toMarker = MarkUtilities.getiMarker(firstAtomType.getLabel(),
AlloyUtilities.getValueOfEntry(itemTypeOfAtom, AlloyUtilities.RESOURCE));
sources.add(toMarker);
}
}
return sources;
}
示例10: handleFParameters
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private void handleFParameters(TMember member, RuleEnvironment G) {
EList<TFormalParameter> fpars = null;
if (member instanceof TMethod) {
TMethod method = (TMethod) member;
fpars = method.getFpars();
}
if (member instanceof TSetter) {
TSetter setter = (TSetter) member;
fpars = new BasicEList<>();
fpars.add(setter.getFpar());
}
if (fpars != null) {
for (int i = 0; i < fpars.size(); i++) {
TFormalParameter fpar = fpars.get(i);
if (fParameters.size() <= i) {
fParameters.add(new ComposedFParInfo());
}
ComposedFParInfo fpAggr = fParameters.get(i);
Pair<TFormalParameter, RuleEnvironment> fpPair = new Pair<>(fpar, G);
fpAggr.fpSiblings.add(fpPair);
}
}
}
示例11: visitExtendsFacet
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Override
public Object visitExtendsFacet(final RAMLParser.ExtendsFacetContext extendsFacet) {
final String extendsUri = extendsFacet.uri.getText();
final RamlResource extendsResource = (RamlResource) scope.getResource(extendsUri);
final EList<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = extendsResource.getErrors();
if (errors.isEmpty()) {
final EList<EObject> contents = extendsResource.getContents();
if (contents.size() != 1) {
scope.addError("Extended api definition is invalid at {0}", extendsFacet);
} else {
final EObject extendsEObject = contents.get(0);
if (extendsEObject instanceof Api && !(extendsEObject instanceof ApiExtension)) {
scope.setValue(ModulesPackage.Literals.API_EXTENSION__EXTENDS, extendsEObject, extendsFacet.uri);
} else {
scope.addError("Extended api definition has invalid type {0} at {1}",
extendsEObject.eClass().getName(), extendsFacet);
}
}
} else {
scope.getResource().getErrors().addAll(errors); // TODO really necessary?
}
return super.visitExtendsFacet(extendsFacet);
}
示例12: dataType
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Test
public void dataType() throws IOException {
final Resource resource = fromClasspath("/includes/data-type-fragment.raml");
final ObjectType objectType = getRootObject(resource);
assertThat(objectType.getName())
.as("Name of a typed fragment")
.isNull();
assertThat(objectType.getDisplayName()).isEqualTo("Person");
final EList<Property> properties = objectType.getProperties();
assertThat(properties)
.hasSize(1);
final Property nameProperty = properties.get(0);
assertThat(nameProperty.getName())
.isEqualTo("age");
assertThat(nameProperty.getType().getName())
.isEqualTo("integer");
}
示例13: generatorLibrary
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Test
public void generatorLibrary() throws IOException {
final Resource resource = fromClasspath("/generator.raml");
assertThat(resource.getErrors()).hasSize(0);
final EList<EObject> contents = resource.getContents();
assertThat(contents).hasSize(1);
final EObject rootObject = contents.get(0);
assertThat(rootObject).isInstanceOf(Library.class);
final Library library = (Library) rootObject;
final EList<AnyAnnotationType> annotationTypes = library.getAnnotationTypes();
assertThat(annotationTypes).hasSize(1);
assertThat(annotationTypes.get(0)).isInstanceOf(StringAnnotationType.class);
final StringAnnotationType annotationStringType = (StringAnnotationType) annotationTypes.get(0);
assertThat(annotationStringType.getAllowedTargets()).containsExactly(AnnotationTarget.LIBRARY);
}
示例14: localeUseLibrary
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Test
public void localeUseLibrary() throws IOException {
final Resource resource = fromClasspath("/locale-use.raml");
assertThat(resource.getErrors()).hasSize(0);
final Library library = getRootObject(resource);
final EList<LibraryUse> uses = library.getUses();
assertThat(uses).hasSize(1);
final LibraryUse localeLibraryUse = uses.get(0);
assertThat(localeLibraryUse.getName()).isEqualTo("locale");
final Library usedLibrary = localeLibraryUse.getLibrary();
assertThat(usedLibrary.getTypes()).hasSize(3);
final EList<AnyType> types = library.getTypes();
assertThat(types).hasSize(1);
assertThat(types.get(0)).isInstanceOf(ObjectType.class);
final ObjectType withLocalizedNameType = (ObjectType) types.get(0);
final EList<Property> properties = withLocalizedNameType.getProperties();
assertThat(properties).hasSize(1);
final Property nameProperty = properties.get(0);
assertThat(nameProperty.getName()).isEqualTo("name");
final AnyType localizedStringType = usedLibrary.getTypes().get(0);
assertThat(nameProperty.getType()).isEqualTo(localizedStringType);
}
示例15: testDescriptionWithUnknownInlineTag
import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@SuppressWarnings("javadoc")
@Test
public void testDescriptionWithUnknownInlineTag() {
String in = "/** This is the description with {@unkonwnInlineTag parsed as text} ..and finish description. \n */";
AbstractInlineTagDefinition inlineTag = new StubInlineTagDefinition("inline");
DocletParser docletParser = new DocletParser(null, new TagDictionary<>(Arrays.asList(inlineTag)));
Doclet doclet = docletParser.parse(in);
EList<ContentNode> contents = doclet.getContents();
Text descr = (Text) contents.get(0);
assertEquals("This is the description with {@unkonwnInlineTag parsed as text} ..and finish description.",
descr.getText());
}