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
|
Iterator<O> |
iterAncestors(O self)
Iterate ancestors (recursive parents)
|
Iterator<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)
Hierarchy
numChildren
in interface Hierarchy<O extends Hierarchical<O>>
self
- object to get number of children forpublic List<O> getChildren(O self)
Hierarchy
getChildren
in interface Hierarchy<O extends Hierarchical<O>>
self
- object to get children forpublic Iterator<O> iterDescendants(O self)
Hierarchy
iterDescendants
in interface Hierarchy<O extends Hierarchical<O>>
self
- object to get descendants forpublic int numParents(O self)
Hierarchy
numParents
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 Iterator<O> iterAncestors(O self)
Hierarchy
iterAncestors
in interface Hierarchy<O extends Hierarchical<O>>
self
- object to get ancestors for