public abstract class AbstractTree<N> extends Object implements Tree<N>
Constructor and Description |
---|
AbstractTree() |
Modifier and Type | Method and Description |
---|---|
void |
forEach(Visitor<N> v)
Allow a visitor to visit each node in the hierarchy.
|
View<N> |
getAncestorView(N o)
Return a
View that includes the specified domain object, and its parent, and that parent's parent, and so on up to the root object. |
View<N> |
getAncestorView(N o,
boolean pIncludeRoot) |
View<N> |
getAncestorView(N o,
int pHeight) |
View<N> |
getAncestorView(N o,
int pHeight,
boolean pIncludeRoot) |
N |
getNextOf(N pObject) |
N |
getPreviousOf(N pObject) |
View<N> |
getRecursiveView()
Returns a
View object that includes the whole tree. |
View<N> |
getRecursiveView(boolean includeRoot)
Return a
View object that includes the whole tree, optionally excluding the root element |
View<N> |
getRecursiveView(int depth)
Return a
View that includes the whole tree, clipped at a specific depth. |
View<N> |
getRecursiveView(int depth,
boolean includeRoot)
Return a
View that includes the whole tree, clipped at a specific depth, optionally
excluding the root object. |
View<N> |
getRecursiveView(N o)
Return a
View that includes the specified domain object,
and all of that objects children. |
View<N> |
getRecursiveView(N o,
boolean includeRoot)
Return a
View that optionally includes the specified domain object,
and all of that objects children. |
View<N> |
getRecursiveView(N o,
int depth)
Return a
View that includes the specified domain object,
and all of that objects children, down to a specific level. |
View<N> |
getRecursiveView(N o,
int depth,
boolean includeRoot)
Return a
View that optionally includes the specified domain object,
and all of that objects children, down to a specific level. |
View<N> |
getView(N o)
Return a
View that includes the specified object, and no other objects. |
boolean |
isRoot(N o)
Returns true if the specified object is the root node.
|
Iterator<N> |
iterator()
Iterates over the whole tree
|
Relationships<N> |
relationships(N pBase,
N pCurrent)
Creates a generic Relationships T.
|
Walker<N> |
walker(View<N> view)
Return an iterator ("walker") that will go through the specified view
in natural order,
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildCount, getChildOf, getParentOf, getRoot
forEach, spliterator
public boolean isRoot(N o)
Tree
public void forEach(Visitor<N> v)
Tree
public Iterator<N> iterator()
iterator
in interface Iterable<N>
Iterable.iterator()
public Walker<N> walker(View<N> view)
Tree
public View<N> getRecursiveView(N o)
Tree
View
that includes the specified domain object,
and all of that objects children. In effect, it gives a domain object's
sub-tree.getRecursiveView
in interface Tree<N>
public View<N> getRecursiveView(N o, int depth)
Tree
View
that includes the specified domain object,
and all of that objects children, down to a specific level.getRecursiveView
in interface Tree<N>
public View<N> getRecursiveView()
Tree
View
object that includes the whole tree.getRecursiveView
in interface Tree<N>
public View<N> getRecursiveView(int depth)
Tree
View
that includes the whole tree, clipped at a specific depth.getRecursiveView
in interface Tree<N>
depth
- a number typically greater than one. 1 means the domain object itself, 2 means the domain object and its direct children, 3 means one additional level.public View<N> getRecursiveView(N o, boolean includeRoot)
Tree
View
that optionally includes the specified domain object,
and all of that objects children. In effect, it gives a domain object's
sub-tree.getRecursiveView
in interface Tree<N>
public View<N> getRecursiveView(N o, int depth, boolean includeRoot)
Tree
View
that optionally includes the specified domain object,
and all of that objects children, down to a specific level.getRecursiveView
in interface Tree<N>
public View<N> getRecursiveView(boolean includeRoot)
Tree
View
object that includes the whole tree, optionally excluding the root elementgetRecursiveView
in interface Tree<N>
public View<N> getRecursiveView(int depth, boolean includeRoot)
Tree
View
that includes the whole tree, clipped at a specific depth, optionally
excluding the root object.getRecursiveView
in interface Tree<N>
depth
- a number typically greater than one. 1 means the domain object itself, 2 means the domain object and its direct children, 3 means one additional level.public View<N> getAncestorView(N o)
Tree
View
that includes the specified domain object, and its parent, and that parent's parent, and so on up to the root object. The returned view represents a view of all of the ancestors of the specified domain object.getAncestorView
in interface Tree<N>
o
- The domain object whose ancestors are to be returnedpublic View<N> getView(N o)
Tree
View
that includes the specified object, and no other objects.public Relationships<N> relationships(N pBase, N pCurrent)
relationships
in interface Tree<N>
public N getPreviousOf(N pObject)
getPreviousOf
in interface Tree<N>
© 1998- 2018 Stibo DX