ARoad0.gBaseInterface
Interface ImmutableNameISTree

All Superinterfaces:
java.lang.Cloneable, ImmutableNameTree
All Known Implementing Classes:
NameISTreeImpl

public interface ImmutableNameISTree
extends ImmutableNameTree

This class is responsible for managing specifically for IS nametrees, a tree of ImmutableNames with specific links to the other nodes. Most of the properties are directly managed by the calling class.

A node in a ImmutableNameLinkTree may have to apply some inner properties or some constraints in its links to other nodes of the whole nametree:

- 'Open' is a mandatory node property which has the value 'true' if the node is active, like an open ACS, subACS or Area, which is currently opened in the program, or if the node is a passive one which is the direct or indirect parent of an opened active node.

- 'ExtendedExtendedVisibleSpace' is a mandatory node property which extends the parent children (if ImmutableNameTree.isHubNode is true) and the ImmutableNameTree areas of the node, if any. This property is an ImmutableName/String Map:

the possible String values are ImmutableNameLinkTree constants:

ALL_THE_NAMETREE_SPACE,

ONE_STEP_NODES_SPACE, TWO_STEPS_NODES_SPACE, THREE_STEPS_NODES_SPACE,

DIRECT_CHILDREN_SPACE, INDIRECT_CHILDREN_SPACE,

PARENT_INDIRECT_CHILDREN_SPACE, PARENT_SPACE,

NO_VISIBLE_SPACE,

the first value is the default one.

- 'Alternates' is an optional node property, used only for the Alternate relation, with an ImmutableName/ImmutableName[] Map:

mandatory key: node_name for a ground ACS or subACS;

the values are the names of the alternates for the key (limited to 4).

- 'MandatoryPaths' is an optional node property, used for IS nametrees only, with an ImmutableName/ImmutableName[] Map:

optional key: node_name is the beginning of the path;

value: the optional array of node names is the structurally-mandatory path to go accross, where the structure is a one-item List, or a List

(first_node, second_node, beginning_node, third_node, fourth_node, beginning_node),

which indicates that there are two paths: from beginning_node to second_node,

and from beginning_node to third_node and fourth_node,

and (feature to be implemented) where all the nodes are in the visible space of the beginning node.

- 'Links' is an optional node property, for IS nametrees, with an ImmutableName/String[] map.

Each property may have any format, and is defined by the user of this class.

This Links map is used for IS nametrees, and the ACS factory initializes the ImmutableNameLinkTree links following some specific and complex uses.

All the properties of a ImmutableNameLinkTree are mutually independant. In other words, a node which is opened or closed may have any visible space, any mahdatory paths and any links. Then, before the use of the data about a mandatory path or a link, it is recommanded to see if the relevant node is opened or not. See also 'isActiveNode' and 'isHubNode' properties in the super class ImmutableNameTree.


Method Summary
 java.util.List<ImmutableName> getAlternates(ImmutableName _node)
          Get the node property for the Alternate relation: mandatory key: node_name; the values are the names of the alternates for the key which is a ground, and (ISFactoryUtilityImpl.IS_ALTERNATE_OF+ground name) for the key which is an alternate.
 java.lang.String getExtendedVisibleSpace(ImmutableName _node)
          Returns the nodes which are visible.
 java.lang.String[] getExtendedVisibleSpaceConstants()
          Get the authorized visible spaces.
 java.util.List<ImmutableName> getGroundsOfAlternate(ImmutableName _alter)
          Get the grounds for which the argument is an Alternate.
 java.lang.String[] getLinks(ImmutableName _name)
          Gets the optional links for a name, which depends on the ImmutableNameISTree use.
 java.util.List<ImmutableName[]> getMandatoryPaths(ImmutableName _node)
          Returns the mandatory paths from a node to access to other nodes, if rights allow it.
 boolean isChildOfAcsNode(ImmutableName _node)
          Gets if a node is the direct or indirect child of at least one node having the type ISImpl.ACS_NODE.
 boolean isLinked(ImmutableName _node, java.lang.String _link)
          Test a special link for a node.
 boolean isMandatoryPath(ImmutableName _node, ImmutableName[] _l_path)
          Test a path as mandatory path from a node to access to other nodes.
 boolean isOpen(ImmutableName _node)
          Get the state open/closed of a node.
 boolean isParentOfAcsNode(ImmutableName _node)
          Get if a node is the direct or indirect parent of at least one node having the type ISImpl.ACS_NODE.
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableNameTree
equals, getChild, getChildCount, getDepthFirstIndexInNameTree, getIndexInParent, getL_AllChildren, getL_AreaNames, getL_AreasOfNode, getL_DirectChildren, getL_NodesOfArea, getLevel, getM_AreaNodes, getParent, getRoot, getSerialVersionUID, getSubTree, getTreePath, getType, hashCode, isArea, isEmpty, isHubNode, isLeaf, isNode, nbOfLevels, nbOfNodesAndAreas, nodes
 

Method Detail

isOpen

boolean isOpen(ImmutableName _node)
Get the state open/closed of a node.

Parameters:
_node - is a node in the ImmutableNameLinkTree
Returns:
true if the node is opened; always false if it is null or unknown.

getGroundsOfAlternate

java.util.List<ImmutableName> getGroundsOfAlternate(ImmutableName _alter)
Get the grounds for which the argument is an Alternate.

Parameters:
_alter - is a node name or derived from a node name.
Returns:
the list of grounds for _node as alternate. May be null.

getAlternates

java.util.List<ImmutableName> getAlternates(ImmutableName _node)
Get the node property for the Alternate relation:

mandatory key: node_name;

the values are the names of the alternates for the key which is a ground, and (ISFactoryUtilityImpl.IS_ALTERNATE_OF+ground name) for the key which is an alternate.

Parameters:
_node - is a non-null node name of a ground
Returns:
the array of alternates for _node. May be null but not empty.

getExtendedVisibleSpaceConstants

java.lang.String[] getExtendedVisibleSpaceConstants()
Get the authorized visible spaces.

Returns:
a copy of the authorized visible spaces for the NameLinkTrees.

getExtendedVisibleSpace

java.lang.String getExtendedVisibleSpace(ImmutableName _node)
Returns the nodes which are visible. The value is one of these constants: ALL_THE_NAMETREE_SPACE/PARENT_INDIRECT_CHILDREN_SPACE/ TWO_STEPS_NODES_SPACE/ONLY_PARENT_SPACE_DIRECT_CHILDREN_SPACE/ONLY_DIRECT_CHILDREN_SPACE/ ONLY_PARENT_SPACE/NO_VISIBLE_SPACE

.

Parameters:
_node - is a non-null node in the ImmutableNameLinkTree
Returns:
the visible space from the node. May be null.

getMandatoryPaths

java.util.List<ImmutableName[]> getMandatoryPaths(ImmutableName _node)
Returns the mandatory paths from a node to access to other nodes, if rights allow it. The returned value is a list of node name arrays, which are the mandatory paths to go accross. Exemples of the array structure is an one-item List, or a List

(first_node, second_node, beginning_node, third_node, fourth_node, beginning_node),

which indicates that there are two paths: from beginning_node to second_node,

and from beginning_node to third_node and fourth_node,

and where all the nodes are in the visible space of the beginning node

Parameters:
_node - is a node in the ImmutableNameLinkTree
Returns:
the list of arrays for mandatory paths copies. May be null.

isMandatoryPath

boolean isMandatoryPath(ImmutableName _node,
                        ImmutableName[] _l_path)
Test a path as mandatory path from a node to access to other nodes. The path is described as an array of node names which are the mandatory paths to go accross. An exemple of the array structure is:

(first_node||second_node||beginning_node||third_node||fourth_node||beginning_node),

which indicates that there are two paths: from beginning_node to second_node,

and from beginning_node to third_node and fourth_node,

and where all the nodes are in the visible space of the beginning node

Parameters:
_node - is a non-null node in the ImmutableNameLinkTree
_l_path - is the array of the path to test, without _node. Never null.
Returns:
true if _l_path is a mandatory path of _node

isLinked

boolean isLinked(ImmutableName _node,
                 java.lang.String _link)
Test a special link for a node.

Parameters:
_node - is a non-null node in the ImmutableNameLinkTree
_link - is a link to test for the node.
Returns:
true if _link is a link of _node

getLinks

java.lang.String[] getLinks(ImmutableName _name)
Gets the optional links for a name, which depends on the ImmutableNameISTree use.

Parameters:
_name - is a node/area name or the association of two node/area names in the ImmutableNameISTree
Returns:
the links. May be a 0-length array. Never null.

isParentOfAcsNode

boolean isParentOfAcsNode(ImmutableName _node)
Get if a node is the direct or indirect parent of at least one node having the type ISImpl.ACS_NODE.

Parameters:
_node - is a node in the ImmutableNameISTree
Returns:
true if the node is a ACS_NODE parent.

isChildOfAcsNode

boolean isChildOfAcsNode(ImmutableName _node)
Gets if a node is the direct or indirect child of at least one node having the type ISImpl.ACS_NODE. The argument may be an area.

Parameters:
_node - is a node or an area in the ImmutableNameISTree
Returns:
true if the argument is a child