Interface Hierarchy<O>

  • Type Parameters:
    O - Object type
    All Known Subinterfaces:
    ModifiableHierarchy<O>
    All Known Implementing Classes:
    HashMapHierarchy, VisualizationTree

    public interface Hierarchy<O>
    This interface represents an (external) hierarchy of objects. It can contain arbitrary objects, BUT the hierarchy has to be accessed using the hierarchy object, i.e. hierarchy.iterChildren(object);.
    Since:
    0.2
    Author:
    Erich Schubert
    • Method Detail

      • size

        int size()
        Total size - number of objects contained.
        Returns:
        Size
      • contains

        boolean contains​(O object)
        Check if an object is part of a hierarchy.
        Parameters:
        object - Object to check
        Returns:
        true if part of the hierarchy
      • numChildren

        int numChildren​(O self)
        Get number of children
        Parameters:
        self - object to get number of children for
        Returns:
        number of children
      • iterChildren

        It<O> iterChildren​(O self)
        Iterate over the (direct) children.
        Parameters:
        self - object to get children for
        Returns:
        iterator for children
      • iterChildrenReverse

        It<O> iterChildrenReverse​(O self)
        Iterate over the (direct) children in reverse order.
        Parameters:
        self - object to get children for
        Returns:
        iterator for children
      • iterDescendants

        It<O> iterDescendants​(O self)
        Iterate descendants (recursive children)
        Parameters:
        self - object to get descendants for
        Returns:
        iterator for descendants
      • iterDescendantsSelf

        It<O> iterDescendantsSelf​(O self)
        Iterate descendants (recursive children) and self.
        Parameters:
        self - object to get descendants for
        Returns:
        iterator for descendants
      • numParents

        int numParents​(O self)
        Get number of (direct) parents
        Parameters:
        self - reference object
        Returns:
        number of parents
      • iterParents

        It<O> iterParents​(O self)
        Iterate over the (direct) parents.
        Parameters:
        self - object to get parents for
        Returns:
        iterator of parents
      • iterParentsReverse

        It<O> iterParentsReverse​(O self)
        Iterate over the (direct) parents in reverse order.
        Parameters:
        self - object to get parents for
        Returns:
        iterator of parents
      • iterAncestors

        It<O> iterAncestors​(O self)
        Iterate ancestors (recursive parents)
        Parameters:
        self - object to get ancestors for
        Returns:
        iterator for ancestors
      • iterAncestorsSelf

        It<O> iterAncestorsSelf​(O self)
        Iterate ancestors (recursive parents) and self.
        Parameters:
        self - object to get ancestors for
        Returns:
        iterator for ancestors
      • iterAll

        It<O> iterAll()
        Iterate over all members.
        Returns:
        Iterator over all members.