public class ComponentLookup extends Object
| Constructor and Description |
|---|
ComponentLookup(ComponentNode top) |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentNodeToLookup(String name,
ComponentNode node) |
boolean |
containsComponent(Object obj) |
boolean |
containsComponentName(String name)
Check if the ComponentLookup already contains a ComponentNode for a given name.
|
<N> Map<String,N> |
getChildren(String parentName,
Class<N> classFilter)
gets the children of a Component in the ComponentNode and filters by
Class.
|
Object |
getComponentByName(String name)
return any object registered by the componentNodeDictionaries of the service.
|
String |
getFullPathFor(String componentName)
Returns the path of a component in the tree of components.
|
String |
getNameOfComponent(Object obj) |
ComponentNode |
getNodeByName(String name) |
Map.Entry<String,Object> |
getParent(String componentName)
gets the Parent of a component in the ComponentNode tree.
|
ComponentNode |
getTopComponentNode()
Get the top ComponentNode, ie the tip of the tree structure.
|
<Q> List<Q> |
listChildren(String parentName,
Class<Q> klass)
lists the children of a component.
|
<N> List<N> |
listDescendants(String parentName,
Class<N> classFilter)
Finds all the children of the given class in the sub-tree starting at the
node named
parentName |
public ComponentLookup(ComponentNode top)
public ComponentNode getTopComponentNode()
public void addComponentNodeToLookup(String name, ComponentNode node)
name - the parent name.node - public Object getComponentByName(String name)
name - public boolean containsComponentName(String name)
name - The name of the ComponentNodepublic ComponentNode getNodeByName(String name)
public <N> Map<String,N> getChildren(String parentName, Class<N> classFilter)
N - the type of nodeparentName - classFilter - the class filter. Any class if set to nullparentName, mapped by their name. The
returned map does not preserved the order in which nodes were inserted in
the component nodepublic <N> List<N> listDescendants(String parentName, Class<N> classFilter)
parentNameN - parentName - the name of the node to start getting the children
from. If set to null, the whole component tree is tested against the
filter, even the top node.classFilter - the class filter. Any class if set to nullpublic <Q> List<Q> listChildren(String parentName, Class<Q> klass)
Q - the type of nodeparentName - klass - public Map.Entry<String,Object> getParent(String componentName)
componentName - public String getFullPathFor(String componentName)
componentName - public boolean containsComponent(Object obj)
Copyright © 2017 LSST. All rights reserved.