Class ContextBranch
- All Implemented Interfaces:
Iterable<Object>, Collection<Object>, List<Object>, SequencedCollection<Object>, ContextTree
A branch in the context tree.
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionContextBranch(ContextRoot tree, Object root) Constructs a ContextBranch with a single root object.ContextBranch(ContextRoot tree, List<Object> branch) Constructs a ContextBranch with a list of objects forming the branch. -
Method Summary
Methods inherited from class AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Constructor Details
-
ContextBranch
Constructs a ContextBranch with a single root object.- Parameters:
tree- the context root tree.root- the root object of the branch.
-
ContextBranch
Constructs a ContextBranch with a list of objects forming the branch.- Parameters:
tree- the context root tree.branch- the list of objects in the branch.
-
-
Method Details
-
addBranch
Adds a new branch with the given object.- Specified by:
addBranchin interfaceContextTree- Parameters:
object- the object to add to the branch.- Returns:
- the key of the added branch.
-
root
-
size
public int size()- Specified by:
sizein interfaceCollection<Object>- Specified by:
sizein interfaceList<Object>- Specified by:
sizein classAbstractCollection<Object>
-
toString
- Overrides:
toStringin classAbstractCollection<Object>
-
listIterator
- Specified by:
listIteratorin interfaceList<Object>- Specified by:
listIteratorin classAbstractSequentialList<Object>
-