Package elki.result

Class Metadata.Hierarchy

  • Enclosing class:
    Metadata

    public final class Metadata.Hierarchy
    extends java.lang.Object
    Class to represent hierarchy information.
    Author:
    Erich Schubert
    • 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.
    • Constructor Detail

      • Hierarchy

        public Hierarchy()
    • 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