Class ChildrenListImpl
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.eclipse.emf.common.util.AbstractEList<E>
-
- org.eclipse.emf.common.util.BasicEList<java.lang.Object>
-
- org.eclipse.emf.ecp.internal.core.util.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>
-
-
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.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecp.spi.core.util.InternalChildrenList
size
-
-
-
-
Constructor Detail
-
ChildrenListImpl
public ChildrenListImpl(java.lang.Object parent)
The ChildrenListImpl constructor.- Parameters:
parent
- the parent object of thisChildrenListImpl
-
-
Method Detail
-
getParent
public final java.lang.Object getParent()
Return the parent element of this list.- Specified by:
getParent
in interfaceInternalChildrenList
- Returns:
- the parent of the list
-
hasChildren
public boolean hasChildren()
Whether this list has children.- Specified by:
hasChildren
in interfaceInternalChildrenList
- 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 interfaceInternalChildrenList
- 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 interfaceInternalChildrenList
- Parameters:
index
- the index of the element to get- Returns:
- the element
-
addChildWithoutRefresh
public void addChildWithoutRefresh(java.lang.Object child)
- Specified by:
addChildWithoutRefresh
in interfaceInternalChildrenList
-
addChild
public final void addChild(java.lang.Object child)
Adds a child to the list.- Specified by:
addChild
in interfaceInternalChildrenList
- Parameters:
child
- the child
-
addChildren
public final <T> void addChildren(T... children)
- Specified by:
addChildren
in interfaceInternalChildrenList
-
addChildren
public final <T> void addChildren(java.util.Collection<T> children)
Adds a list of children to the list.- Specified by:
addChildren
in interfaceInternalChildrenList
- Parameters:
children
- a collection of new children
-
isSlow
public boolean isSlow()
Whether this list is slow or not.- Specified by:
isSlow
in interfaceInternalChildrenList
- Returns:
- true if it is slow, false otherwise
-
isComplete
public boolean isComplete()
Whether this list is complete or not.- Specified by:
isComplete
in interfaceInternalChildrenList
- Returns:
- true if it is complete, false otherwise
-
setComplete
public void setComplete()
- Specified by:
setComplete
in interfaceInternalChildrenList
-
childrenAdded
protected void childrenAdded()
This method is called whenever a child is added. Subclasses interested in this information should overwrite this method.
-
-