Class 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 Details

  • Constructor Details

    • ContainableModelElementList

      public ContainableModelElementList(IModelElement parent)
      Creates a new model element list.
      Parameters:
      parent - the parent (scope, may be null)
    • ContainableModelElementList

      public ContainableModelElementList(int initialCapacity, IModelElement parent)
      Creates a new model element list.
      Parameters:
      initialCapacity - the initial capacity of the list
      parent - the parent (scope, may be null)
  • Method Details

    • getElement

      public ContainableModelElement getElement(int index)
      Description copied from interface: IResolutionScope
      Returns a contained model element specified by index.
      Specified by:
      getElement in interface IResolutionScope
      Parameters:
      index - a 0-based index specifying the operation to be returned
      Returns:
      the contained element
    • getElementCount

      public int getElementCount()
      Description copied from interface: IResolutionScope
      Returns the number of contained elements.
      Specified by:
      getElementCount in interface IResolutionScope
      Returns:
      the number of contained elements
    • getImportsCount

      public int getImportsCount()
      Description copied from interface: IResolutionScope
      Returns the number of imports.
      Specified by:
      getImportsCount in interface IResolutionScope
      Returns:
      the number of imports
    • getImport

      public ProjectImport getImport(int index)
      Description copied from interface: IResolutionScope
      Returns the project import specified by index.
      Specified by:
      getImport in interface IResolutionScope
      Parameters:
      index - a 0-based index specifying the import to be returned
      Returns:
      the project import
    • getParent

      public IModelElement getParent()
      Description copied from interface: IResolutionScope
      Returns the parent model element.
      Specified by:
      getParent in interface IResolutionScope
      Returns:
      the parent model element (may be null)
    • getName

      public String getName()
      Returns the (unqualified) name of the scope.
      Specified by:
      getName in interface IResolutionScope
      Returns:
      the unqualified name of the scope
    • hasInterfaces

      public boolean hasInterfaces()
      Returns whether this project has interfaces.
      Specified by:
      hasInterfaces in interface IResolutionScope
      Returns:
      true if it has interfaces, false else
    • isInterface

      public boolean isInterface()
      Description copied from interface: IResolutionScope
      Returns whether this scope is an interfaces.
      Specified by:
      isInterface in interface IResolutionScope
      Returns:
      true if it is an interface, false else
    • getElement

      public ContainableModelElement getElement(String name)
      Description copied from interface: IResolutionScope
      Returns a contained model element specified by its name.
      Specified by:
      getElement in interface IResolutionScope
      Parameters:
      name - the qualified or unqualified name to search for
      Returns:
      the related element or null if no such element is known