
O - Type of objects in hierarchypublic class HierarchyReferenceLists<O extends Hierarchical<O>> extends Object implements Hierarchy<O>
| Modifier and Type | Class and Description |
|---|---|
private class |
HierarchyReferenceLists.ItrAnc
Iterator over all Ancestors.
|
private class |
HierarchyReferenceLists.ItrDesc
Iterator to collect into the descendants.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<O> |
children
Storage for children
|
protected O |
owner
Owner
|
protected List<O> |
parents
Storage for parents
|
| Constructor and Description |
|---|
HierarchyReferenceLists(O owner,
List<O> children,
List<O> parents)
Constructor for hierarchy object.
|
| Modifier and Type | Method and Description |
|---|---|
List<O> |
getChildren(O self)
Get children list.
|
List<O> |
getParents(O self)
Return parents
|
IterableIterator<O> |
iterAncestors(O self)
Iterate ancestors (recursive parents)
|
IterableIterator<O> |
iterDescendants(O self)
Iterate descendants (recursive children)
|
int |
numChildren(O self)
Get number of children
|
int |
numParents(O self)
Get number of (direct) parents
|
protected O extends Hierarchical<O> owner
protected List<O extends Hierarchical<O>> children
protected List<O extends Hierarchical<O>> parents
public int numChildren(O self)
HierarchynumChildren in interface Hierarchy<O extends Hierarchical<O>>self - object to get number of children forpublic List<O> getChildren(O self)
HierarchygetChildren in interface Hierarchy<O extends Hierarchical<O>>self - object to get children forpublic IterableIterator<O> iterDescendants(O self)
HierarchyiterDescendants in interface Hierarchy<O extends Hierarchical<O>>self - object to get descendants forpublic int numParents(O self)
HierarchynumParents in interface Hierarchy<O extends Hierarchical<O>>self - reference objectpublic List<O> getParents(O self)
getParents in interface Hierarchy<O extends Hierarchical<O>>self - object to get parents forpublic IterableIterator<O> iterAncestors(O self)
HierarchyiterAncestors in interface Hierarchy<O extends Hierarchical<O>>self - object to get ancestors for