|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ImmutableNameTree
This class is responsible for managing a tree of ImmutableNames for all the base objects. The nodes are ImmutableNames, but there is no constraint between a node name and its parent node name (that is, the node name may integer the parent name or not). The links between nodes are parent-child relations.
This interface uses the relevant methods of javax.swing.tree.DefaultTreeModel. There is always a non-null name as root. There is no order in the children list of a node. An name cannot be a node twice in the same nametree.
This class is used by IS, component and ACS trees. It is possible to get subtrees, that is a new nametree with all the indirect children. It is also possible to get areas. Area is defined as a group of connected nodes in the nametree, with a single root, which is used for mapping components to a virtual structure like an IS domain.
Method Summary | |
---|---|
boolean |
equals(java.lang.Object _obj)
This method compare the node lists, not the parent-child relations. |
ImmutableName |
getChild(ImmutableName _parent,
int _index)
Get one of the children in the nametree |
int |
getChildCount(ImmutableName _parent)
Get the number of children for a node in the nametree, in reading its proper children count. |
int |
getDepthFirstIndexInNameTree(ImmutableName _child)
Gets the current index of a child in its nametree, as the child appears in the IS structure o the GUI, following a depth-first order. |
int |
getIndexInParent(ImmutableName _child)
Returns the current index of a child in its parent array in the nametree. |
java.util.List<ImmutableName> |
getL_AllChildren(ImmutableName _parent)
Get all the direct and indirect children of a node in the nametree. |
java.util.Set<ImmutableName> |
getL_AreaNames()
Get the set of all the nametree areas, if any. |
java.util.List<ImmutableName> |
getL_AreasOfNode(ImmutableName _name)
Get the areas of the nametree, the node belongs to. |
java.util.List<ImmutableName> |
getL_DirectChildren(ImmutableName _parent)
Get all the direct children of a node in the nametree. |
java.util.List<ImmutableName> |
getL_NodesOfArea(ImmutableName _name)
Get the nodes belonging to an area of the nametree. |
int |
getLevel(ImmutableName _node)
Get the level of a node in the nametree. |
java.util.Map |
getM_AreaNodes()
Get all the areas of this nametree, with their node names. |
ImmutableName |
getParent(ImmutableName _child)
Get the parent of a nametree node. |
ImmutableName |
getRoot()
Get the root of the nametree |
long |
getSerialVersionUID()
|
ImmutableNameTree |
getSubTree(ImmutableName _root)
Get a subtree from the nametree, with all the indirect children. |
javax.swing.tree.TreePath |
getTreePath(ImmutableName _startingNode,
ImmutableName _endingNode)
Get the path of nodes between two nodes in the nametree, if one of the two nodes is an indirect child of the other one. |
java.lang.String |
getType(ImmutableName _node)
Get the type of the node. |
int |
hashCode()
|
boolean |
isArea(ImmutableName _name)
Test a name as area of the nametree. |
boolean |
isEmpty()
|
boolean |
isHubNode(ImmutableName _node)
Test if a node of the nametree is set as a 'hub' for its children. |
boolean |
isLeaf(ImmutableName _node)
Test if a node is a leaf of the nametree, in reading its proper children count. |
boolean |
isNode(ImmutableName _name)
Test a name as node of the nametree, including the root. |
int |
nbOfLevels()
|
int |
nbOfNodesAndAreas()
|
java.util.Set<ImmutableName> |
nodes()
Get the set of all the nametree nodes, including the root and excluding the areas. |
Method Detail |
---|
boolean isEmpty()
ImmutableName getRoot()
ImmutableNameTree getSubTree(ImmutableName _root) throws BaseError
_root
- this non-null node of the nametree is the subtree root,
which is not the nametree root.
BaseError
- if the root is the nametree root, null, empty,
does not belong to the nametree, or if non-consistent data is detected.javax.swing.tree.TreePath getTreePath(ImmutableName _startingNode, ImmutableName _endingNode) throws BaseError
_startingNode
- is a nametree node_endingNode
- is a nametree node which is at a lower or a greater level
than _startingNode
BaseError
- if one of the two arguments does not belong to the nametree,
or if the nametree data is not consistent.java.util.Set<ImmutableName> nodes()
java.util.Set<ImmutableName> getL_AreaNames()
java.util.Map getM_AreaNodes()
int nbOfNodesAndAreas()
int nbOfLevels()
boolean isNode(ImmutableName _name)
_name
- to test
boolean isArea(ImmutableName _name)
_name
- to test
java.util.List<ImmutableName> getL_NodesOfArea(ImmutableName _name)
_name
- of an area of the nametree
java.util.List<ImmutableName> getL_AreasOfNode(ImmutableName _name)
_name
- of a node of the nametree
int getLevel(ImmutableName _node)
_node
- has to be a nametree node
ImmutableName getParent(ImmutableName _child)
_child
- has to be a nametree node name, not an area name
ImmutableName getChild(ImmutableName _parent, int _index)
_parent
- is a parent in the nametree_index
- in the parent's child array
java.util.List<ImmutableName> getL_DirectChildren(ImmutableName _parent)
_parent
- is a node in the nametree
getL_AllChildren(ARoad0.gBaseInterface.ImmutableName)
java.util.List<ImmutableName> getL_AllChildren(ImmutableName _parent)
_parent
- is a node in the nametree
getL_DirectChildren(ARoad0.gBaseInterface.ImmutableName)
java.lang.String getType(ImmutableName _node) throws BaseError
BaseError
- if _node is null or an empty name,
or does not belong to the nametree.boolean isHubNode(ImmutableName _node) throws BaseError
BaseError
- if _node is null or an empty name,
or does not belong to the nametree.int getChildCount(ImmutableName _parent) throws BaseError
_parent
- is a node in the nametree
BaseError
- if the parent is null or does not belong to the nametreeboolean isLeaf(ImmutableName _node) throws BaseError
_node
- is a node to test
BaseError
- if the node is null or does not belong to the nametreeint getIndexInParent(ImmutableName _child)
_child
- is the node we are interested in
int getDepthFirstIndexInNameTree(ImmutableName _child) throws BaseError
_child
- is the node or an area of the nametree
BaseError
- if the arguments does not belong to the nametree,
or if the nametree data is not consistent.boolean equals(java.lang.Object _obj)
equals
in class java.lang.Object
_obj
- is the object to compare
int hashCode()
hashCode
in class java.lang.Object
long getSerialVersionUID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |