Class HierarchySet
- java.lang.Object
-
- cern.nxcals.api.backport.domain.core.metadata.HierarchySet
-
- All Implemented Interfaces:
java.io.Serializable
public class HierarchySet extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HierarchySet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHierarchy(Hierarchy hierarchy)
Adds the given Hierarchy object to the HierarchySet.static java.util.stream.Collector<Hierarchy,HierarchySet,HierarchySet>
collector()
java.util.SortedSet<Hierarchy>
getAllHierachies()
Gets a List of all the Hierarchy objects within the HierarchySet.java.util.SortedSet<Hierarchy>
getChildHierarchies(Hierarchy hierarchy)
Gets a List of Hierarchy objects which are child nodes of the given Hierarchy.Hierarchy
getChildHierarchy(Hierarchy hierarchy, int index)
Gets the child Hierarchy of the given Hierarchy at the given index.int
getChildHierarchyCount(Hierarchy hierarchy)
Gets a count of the Hierarchy objects which are children of the given Hierarchy.java.util.SortedSet<Hierarchy>
getHierachies(int nodeLevel)
Gets a List of all the Hierarchy objects within the HierarchySet at the given node level.java.util.Set<java.lang.Integer>
getHierachyLevels()
Gets a Set of Integers which represent the distinct node levels of all Hierarchy objects within the HierarchySet.int
getHierarchyCount()
Gets a count of the number of Hierarchy objects within the HierarchySet.int
getIndexOfChildHierarchy(Hierarchy hierarchy, Hierarchy child)
Gets the index of the child Hierarchy belonging to the parent Hierarchy.Hierarchy
getParentHierarchy(Hierarchy hierarchy)
Gets the parent Hierarchy of the given Hierarchy.
-
-
-
Method Detail
-
collector
public static java.util.stream.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 java.util.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 java.util.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 java.util.Set<java.lang.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 Hierarchychild
- - the child Hierarchy whose index is required- Returns:
- - the index of the child Hierarchy belonging to the parent Hierarchy.
-
getHierachies
public java.util.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.
-
-