Package net.ssehub.easy.varModel.model
Class ContainableModelElementList
java.lang.Object
java.util.AbstractCollection<ContainableModelElement>
java.util.AbstractList<ContainableModelElement>
java.util.ArrayList<ContainableModelElement>
net.ssehub.easy.varModel.model.ContainableModelElementList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<ContainableModelElement>,Collection<ContainableModelElement>,List<ContainableModelElement>,RandomAccess,SequencedCollection<ContainableModelElement>,IResolutionScope
public class ContainableModelElementList
extends ArrayList<ContainableModelElement>
implements IResolutionScope
A list of containable model elements which acts as
IResolutionScope.
Note that such a list does neither provides imports nor a name and is more
or less intended to be considered for searching specific elements
in ModelQuery.- Author:
- Holger Eichelberger
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IModelElementprivate static final longIdentification for serialization.Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionContainableModelElementList(int initialCapacity, IModelElement parent) Creates a new model element list.Creates a new model element list. -
Method Summary
Modifier and TypeMethodDescriptiongetElement(int index) Returns a contained model element specified byindex.getElement(String name) Returns a contained model element specified by itsname.intReturns the number of contained elements.getImport(int index) Returns the project import specified byindex.intReturns the number of imports.getName()Returns the (unqualified) name of the scope.Returns the parent model element.booleanReturns whether this project has interfaces.booleanReturns whether this scope is an interfaces.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDIdentification for serialization.- See Also:
-
parent
-
-
Constructor Details
-
ContainableModelElementList
Creates a new model element list.- Parameters:
parent- the parent (scope, may be null)
-
ContainableModelElementList
Creates a new model element list.- Parameters:
initialCapacity- the initial capacity of the listparent- the parent (scope, may be null)
-
-
Method Details
-
getElement
Description copied from interface:IResolutionScopeReturns a contained model element specified byindex.- Specified by:
getElementin interfaceIResolutionScope- Parameters:
index- a 0-based index specifying the operation to be returned- Returns:
- the contained element
-
getElementCount
public int getElementCount()Description copied from interface:IResolutionScopeReturns the number of contained elements.- Specified by:
getElementCountin interfaceIResolutionScope- Returns:
- the number of contained elements
-
getImportsCount
public int getImportsCount()Description copied from interface:IResolutionScopeReturns the number of imports.- Specified by:
getImportsCountin interfaceIResolutionScope- Returns:
- the number of imports
-
getImport
Description copied from interface:IResolutionScopeReturns the project import specified byindex.- Specified by:
getImportin interfaceIResolutionScope- Parameters:
index- a 0-based index specifying the import to be returned- Returns:
- the project import
-
getParent
Description copied from interface:IResolutionScopeReturns the parent model element.- Specified by:
getParentin interfaceIResolutionScope- Returns:
- the parent model element (may be null)
-
getName
Returns the (unqualified) name of the scope.- Specified by:
getNamein interfaceIResolutionScope- Returns:
- the unqualified name of the scope
-
hasInterfaces
public boolean hasInterfaces()Returns whether this project has interfaces.- Specified by:
hasInterfacesin interfaceIResolutionScope- Returns:
trueif it has interfaces,falseelse
-
isInterface
public boolean isInterface()Description copied from interface:IResolutionScopeReturns whether this scope is an interfaces.- Specified by:
isInterfacein interfaceIResolutionScope- Returns:
trueif it is an interface,falseelse
-
getElement
Description copied from interface:IResolutionScopeReturns a contained model element specified by itsname.- Specified by:
getElementin interfaceIResolutionScope- Parameters:
name- the qualified or unqualified name to search for- Returns:
- the related element or null if no such element is known
-