Package elki.result
Class Metadata.Hierarchy
- java.lang.Object
-
- elki.result.Metadata.Hierarchy
-
- Enclosing class:
- Metadata
public final class Metadata.Hierarchy extends java.lang.Object
Class to represent hierarchy information.- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
Metadata.Hierarchy.ItrAnc
Iterator over all ancestors.private class
Metadata.Hierarchy.ItrChildren
Child iterator.private class
Metadata.Hierarchy.ItrChildrenReverse
Child iterator.private class
Metadata.Hierarchy.ItrDesc
Iterator over all descendants.private class
Metadata.Hierarchy.ItrParents
Parent iterator.private class
Metadata.Hierarchy.ItrParentsReverse
Parent iterator.
-
Constructor Summary
Constructors Constructor Description Hierarchy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addChild(java.lang.Object c)
Add a child to this node.private boolean
addChildInt(java.lang.Object child)
Add a child.private boolean
addParentInt(Metadata parent)
Add a parent.boolean
addWeakChild(java.lang.Object c)
Add a weak child to this node, which may be automatically garbage collected.boolean
hasChildren()
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.boolean
removeChild(java.lang.Object c)
Remove a child from this node.private boolean
removeChildInt(java.lang.Object child)
Remove a child.private boolean
removeParentInt(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:
true
on 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:
true
on success
-
removeChild
public boolean removeChild(java.lang.Object c)
Remove a child from this node.- Parameters:
c
- Child to remove- Returns:
true
on success
-
addParentInt
private boolean addParentInt(Metadata parent)
Add a parent.- Parameters:
parent
- Parent to add.- Returns:
true
when changed
-
addChildInt
private boolean addChildInt(java.lang.Object child)
Add a child.- Parameters:
child
- Child to add- Returns:
true
when changed
-
removeParentInt
private boolean removeParentInt(Metadata parent)
Remove a parent.- Parameters:
parent
- Parent to remove.- Returns:
true
when changed
-
removeChildInt
private boolean removeChildInt(java.lang.Object child)
Remove a child.- Parameters:
child
- Child to remove.- Returns:
true
when changed
-
hasChildren
public boolean hasChildren()
Get the number of children.- Returns:
true
if 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
-
-