Class HierarchySet

java.lang.Object
cern.nxcals.api.backport.domain.core.metadata.HierarchySet
All Implemented Interfaces:
Serializable

public class HierarchySet extends Object implements Serializable
See Also:
  • Constructor Details

    • HierarchySet

      public HierarchySet()
  • Method Details

    • collector

      public static Collector<Hierarchy,HierarchySet,HierarchySet> collector()
    • getParentHierarchy

      public Hierarchy getParentHierarchy(Hierarchy hierarchy)
      Gets the parent Hierarchy of the given Hierarchy.
      Parameters:
      hierarchy - - the Hierarchy of which the parent Hierarchy should be returned.
      Returns:
      the parent Hierarchy of the given Hierarchy.
    • getChildHierarchies

      public SortedSet<Hierarchy> getChildHierarchies(Hierarchy hierarchy)
      Gets a List of Hierarchy objects which are child nodes of the given Hierarchy.
      Parameters:
      hierarchy - - the Hierarchy of which child nodes should be returned.
      Returns:
      a List of Hierarchy objects which are child nodes of the given Hierarchy.
    • getHierarchyCount

      public int getHierarchyCount()
      Gets a count of the number of Hierarchy objects within the HierarchySet.
      Returns:
      a count of the number of Hierarchy objects within the HierarchySet.
    • getAllHierachies

      public SortedSet<Hierarchy> getAllHierachies()
      Gets a List of all the Hierarchy objects within the HierarchySet.
      Returns:
      - a List of all the Hierarchy objects within the HierarchySet.
    • getHierachyLevels

      public Set<Integer> getHierachyLevels()
      Gets a Set of Integers which represent the distinct node levels of all Hierarchy objects within the HierarchySet.
      Returns:
      - a Set of Integers which represent the distinct node levels of all Hierarchy objects within the HierarchySet.
    • getChildHierarchyCount

      public int getChildHierarchyCount(Hierarchy hierarchy)
      Gets a count of the Hierarchy objects which are children of the given Hierarchy.
      Parameters:
      hierarchy - - the Hierarchy for which child Hierarchy objects should be counted.
      Returns:
      a count of the Hierarchy objects which are children of the given Hierarchy.
    • getChildHierarchy

      public Hierarchy getChildHierarchy(Hierarchy hierarchy, int index)
      Gets the child Hierarchy of the given Hierarchy at the given index.
      Parameters:
      hierarchy - - the parent Hierarchy of which the child Hierarchy at the given index should be returned.
      Returns:
      the child Hierarchy of the given Hierarchy at the given index.
    • getIndexOfChildHierarchy

      public int getIndexOfChildHierarchy(Hierarchy hierarchy, Hierarchy child)
      Gets the index of the child Hierarchy belonging to the parent Hierarchy.
      Parameters:
      hierarchy - - the parent Hierarchy
      child - - the child Hierarchy whose index is required
      Returns:
      - the index of the child Hierarchy belonging to the parent Hierarchy.
    • getHierachies

      public SortedSet<Hierarchy> getHierachies(int nodeLevel)
      Gets a List of all the Hierarchy objects within the HierarchySet at the given node level.
      Returns:
      - a List of all the Hierarchy objects within the HierarchySet at the given node level. Returns null if there are no hierarchies at the requested level.
    • addHierarchy

      public void addHierarchy(Hierarchy hierarchy)
      Adds the given Hierarchy object to the HierarchySet.
      Parameters:
      hierarchy - - the Hierarchy object to be added to the HierarchySet.