Package elki.result
Class Metadata.Hierarchy
- java.lang.Object
-
- elki.result.Metadata.Hierarchy
-
- Enclosing class:
- Metadata
public final class Metadata.Hierarchy extends java.lang.ObjectClass to represent hierarchy information.- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classMetadata.Hierarchy.ItrAncIterator over all ancestors.private classMetadata.Hierarchy.ItrChildrenChild iterator.private classMetadata.Hierarchy.ItrChildrenReverseChild iterator.private classMetadata.Hierarchy.ItrDescIterator over all descendants.private classMetadata.Hierarchy.ItrParentsParent iterator.private classMetadata.Hierarchy.ItrParentsReverseParent iterator.
-
Constructor Summary
Constructors Constructor Description Hierarchy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddChild(java.lang.Object c)Add a child to this node.private booleanaddChildInt(java.lang.Object child)Add a child.private booleanaddParentInt(Metadata parent)Add a parent.booleanaddWeakChild(java.lang.Object c)Add a weak child to this node, which may be automatically garbage collected.booleanhasChildren()Get the number of children.It<java.lang.Object>iterAncestors()Iterate over all ancestors.It<java.lang.Object>iterAncestorsSelf()Iterate over all ancestors and the object itself.It<java.lang.Object>iterChildren()Iterate over children.It<java.lang.Object>iterChildrenReverse()Iterate over children, backwards.It<java.lang.Object>iterDescendants()Iterate over all descendants.It<java.lang.Object>iterDescendantsSelf()Iterate over all descendants and the object itself.It<java.lang.Object>iterParents()Iterate over parents.It<java.lang.Object>iterParentsReverse()Iterate over parents, backwards.booleanremoveChild(java.lang.Object c)Remove a child from this node.private booleanremoveChildInt(java.lang.Object child)Remove a child.private booleanremoveParentInt(Metadata parent)Remove a parent.
-
-
-
Field Detail
-
nump
int nump
Number of parents.
-
numc
int numc
Number of children.
-
parents
private Metadata[] parents
Parents.
-
children
private java.lang.Object[] children
Children.
-
-
Method Detail
-
addChild
public boolean addChild(java.lang.Object c)
Add a child to this node.- Parameters:
c- Child to add- Returns:
trueon success
-
addWeakChild
public boolean addWeakChild(java.lang.Object c)
Add a weak child to this node, which may be automatically garbage collected.- Parameters:
c- Child to add- Returns:
trueon success
-
removeChild
public boolean removeChild(java.lang.Object c)
Remove a child from this node.- Parameters:
c- Child to remove- Returns:
trueon success
-
addParentInt
private boolean addParentInt(Metadata parent)
Add a parent.- Parameters:
parent- Parent to add.- Returns:
truewhen changed
-
addChildInt
private boolean addChildInt(java.lang.Object child)
Add a child.- Parameters:
child- Child to add- Returns:
truewhen changed
-
removeParentInt
private boolean removeParentInt(Metadata parent)
Remove a parent.- Parameters:
parent- Parent to remove.- Returns:
truewhen changed
-
removeChildInt
private boolean removeChildInt(java.lang.Object child)
Remove a child.- Parameters:
child- Child to remove.- Returns:
truewhen changed
-
hasChildren
public boolean hasChildren()
Get the number of children.- Returns:
trueif the code has children
-
iterParents
public It<java.lang.Object> iterParents()
Iterate over parents.- Returns:
- Iterator for parents
-
iterParentsReverse
public It<java.lang.Object> iterParentsReverse()
Iterate over parents, backwards.- Returns:
- Iterator for parents
-
iterAncestors
public It<java.lang.Object> iterAncestors()
Iterate over all ancestors.- Returns:
- Iterator for descendants
-
iterAncestorsSelf
public It<java.lang.Object> iterAncestorsSelf()
Iterate over all ancestors and the object itself.- Returns:
- Iterator for descendants
-
iterChildren
public It<java.lang.Object> iterChildren()
Iterate over children.- Returns:
- Iterator for children
-
iterChildrenReverse
public It<java.lang.Object> iterChildrenReverse()
Iterate over children, backwards.- Returns:
- Iterator for children
-
iterDescendants
public It<java.lang.Object> iterDescendants()
Iterate over all descendants.- Returns:
- Iterator for descendants
-
iterDescendantsSelf
public It<java.lang.Object> iterDescendantsSelf()
Iterate over all descendants and the object itself.- Returns:
- Iterator for descendants
-
-