Class ChildrenListImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>, java.util.RandomAccess, org.eclipse.emf.common.util.EList<java.lang.Object>, InternalChildrenList

    public class ChildrenListImpl
    extends org.eclipse.emf.common.util.BasicEList<java.lang.Object>
    implements InternalChildrenList
    Author:
    Eike Stepper
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.emf.common.util.BasicEList

        org.eclipse.emf.common.util.BasicEList.BasicIndexOutOfBoundsException, org.eclipse.emf.common.util.BasicEList.EIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.EListIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.FastCompare<E extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.NonResolvingEIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.NonResolvingEListIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.UnmodifiableEList<E extends java.lang.Object>
    • Field Summary

      • Fields inherited from class org.eclipse.emf.common.util.BasicEList

        data, size
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      ChildrenListImpl​(java.lang.Object parent)
      The ChildrenListImpl constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChild​(java.lang.Object child)
      Adds a child to the list.
      <T> void addChildren​(java.util.Collection<T> children)
      Adds a list of children to the list.
      <T> void addChildren​(T... children)
      void addChildWithoutRefresh​(java.lang.Object child)
      protected void childrenAdded()
      This method is called whenever a child is added.
      java.lang.Object getChild​(int index)
      Returns the object with this index from the list.
      java.lang.Object[] getChildren()
      Returns the children of this list.
      java.lang.Object getParent()
      Return the parent element of this list.
      boolean hasChildren()
      Whether this list has children.
      boolean isComplete()
      Whether this list is complete or not.
      boolean isSlow()
      Whether this list is slow or not.
      void setComplete()
      • Methods inherited from class org.eclipse.emf.common.util.BasicEList

        addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, assign, basicGet, basicList, clear, clone, contains, data, get, grow, indexOf, isEmpty, lastIndexOf, move, newData, primitiveGet, remove, setData, setUnique, shrink, size, toArray, toArray
      • Methods inherited from class org.eclipse.emf.common.util.AbstractEList

        add, add, addAll, addAll, basicIterator, basicListIterator, basicListIterator, canContainNull, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, getDuplicates, getNonDuplicates, hashCode, isUnique, iterator, listIterator, listIterator, move, remove, removeAll, resolve, retainAll, set, toString, useEquals, validate
      • Methods inherited from class java.util.AbstractList

        removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        containsAll
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll, replaceAll, sort, spliterator, subList
    • Constructor Detail

      • ChildrenListImpl

        public ChildrenListImpl​(java.lang.Object parent)
        The ChildrenListImpl constructor.
        Parameters:
        parent - the parent object of this ChildrenListImpl
    • Method Detail

      • getParent

        public final java.lang.Object getParent()
        Return the parent element of this list.
        Specified by:
        getParent in interface InternalChildrenList
        Returns:
        the parent of the list
      • hasChildren

        public boolean hasChildren()
        Whether this list has children.
        Specified by:
        hasChildren in interface InternalChildrenList
        Returns:
        true if this list has children, false otherwise.
      • getChildren

        public java.lang.Object[] getChildren()
        Returns the children of this list.
        Specified by:
        getChildren in interface InternalChildrenList
        Returns:
        an array containing all children
      • getChild

        public java.lang.Object getChild​(int index)
        Returns the object with this index from the list. Throws an IndexOutOfBoundException if index is invalid.
        Specified by:
        getChild in interface InternalChildrenList
        Parameters:
        index - the index of the element to get
        Returns:
        the element
      • addChild

        public final void addChild​(java.lang.Object child)
        Adds a child to the list.
        Specified by:
        addChild in interface InternalChildrenList
        Parameters:
        child - the child
      • addChildren

        public final <T> void addChildren​(java.util.Collection<T> children)
        Adds a list of children to the list.
        Specified by:
        addChildren in interface InternalChildrenList
        Parameters:
        children - a collection of new children
      • isSlow

        public boolean isSlow()
        Whether this list is slow or not.
        Specified by:
        isSlow in interface InternalChildrenList
        Returns:
        true if it is slow, false otherwise
      • isComplete

        public boolean isComplete()
        Whether this list is complete or not.
        Specified by:
        isComplete in interface InternalChildrenList
        Returns:
        true if it is complete, false otherwise
      • childrenAdded

        protected void childrenAdded()
        This method is called whenever a child is added. Subclasses interested in this information should overwrite this method.