public class ResourceTypeManager<T extends ResourceType<?,?,?,?>> extends Object
| Constructor and Description |
|---|
ResourceTypeManager(Map<Name,TypeSet<T>> resourceTypeSetMap)
Adds the given types to the manager, building a graph to represent the type hierarchy.
|
ResourceTypeManager(Map<Name,TypeSet<T>> resourceTypeSetMap,
Collection<Name> setsToUse)
Adds the given types to the manager, building a graph to represent the type hierarchy.
|
| Modifier and Type | Method and Description |
|---|---|
Set<T> |
getAllResourceTypes()
Returns an unordered set of all resource types currently being managed.
|
org.jgrapht.traverse.BreadthFirstIterator<T,org.jgrapht.graph.DefaultEdge> |
getBreadthFirstIterator()
Returns an iterator that let's you walk the tree of resource types breadth-first.
|
Set<T> |
getChildren(T resourceType)
Returns the direct child types of the given resource type.
|
org.jgrapht.traverse.DepthFirstIterator<T,org.jgrapht.graph.DefaultEdge> |
getDepthFirstIterator()
Returns an iterator that let's you walk the tree of resource types depth-first.
|
Set<T> |
getParents(T resourceType)
Returns the direct parent types of the given resource type.
|
org.jgrapht.graph.ListenableDirectedGraph<T,org.jgrapht.graph.DefaultEdge> |
getResourceTypesGraph() |
Set<T> |
getRootResourceTypes()
Returns resource types that are at the top of the hierarchy (that is, they do not have any parent types).
|
public ResourceTypeManager(Map<Name,TypeSet<T>> resourceTypeSetMap) throws IllegalStateException
resourceTypeSetMap - a full set of types to useIllegalStateException - if types are missing (e.g. a type needs a parent but the parent is missing)public ResourceTypeManager(Map<Name,TypeSet<T>> resourceTypeSetMap, Collection<Name> setsToUse) throws IllegalStateException
resourceTypeSetMap - a full set of typessetsToUse - optional set of type names that the manager to care about - it will ignore others it finds.
If null, then the full set is used (by "full set" it means the resourceTypeSetMap param).IllegalStateException - if types are missing (e.g. a type needs a parent but the parent is missing)public org.jgrapht.graph.ListenableDirectedGraph<T,org.jgrapht.graph.DefaultEdge> getResourceTypesGraph()
public org.jgrapht.traverse.BreadthFirstIterator<T,org.jgrapht.graph.DefaultEdge> getBreadthFirstIterator()
public org.jgrapht.traverse.DepthFirstIterator<T,org.jgrapht.graph.DefaultEdge> getDepthFirstIterator()
public Set<T> getRootResourceTypes()
public Set<T> getChildren(T resourceType)
resourceType - the type whose children are to be returnedpublic Set<T> getParents(T resourceType)
resourceType - the type whose parents are to be returnedCopyright © 2015 Red Hat, Inc.. All rights reserved.