Rule Execution Server API

ilog.rules.factory
Class IlrHierarchicalProperty

java.lang.Object
  extended by ilog.rules.factory.IlrHierarchicalProperty
All Implemented Interfaces:
IlrHierarchicalPropertyElement, ilog.rules.factory.IlrRulesetElement, Serializable

public class IlrHierarchicalProperty
extends Object
implements IlrHierarchicalPropertyElement, Serializable

Model of a hierarchical property. It is characterized by a name and a hierarchy between values.

Since:
JRules 6.0
See Also:
Serialized Form

Constructor Summary
IlrHierarchicalProperty(String name)
          Creates a hierarchical property.
 
Method Summary
 void addChildren(String parentPath, List children)
          Adds the children contained in the list to a given parent node.
 void close()
          Declares that the hierarchy definition is finished, in order to make some internal computation.
 IlrHierarchicalPropertyNode createRoot(String rootName)
          Creates a root and attaches it to the hierarchy.
 String getName()
          Returns the name of the hierarchical property.
 IlrHierarchicalPropertyNode getNode(String id)
          Returns the node in the hierarchy whose name is given as parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrHierarchicalProperty

public IlrHierarchicalProperty(String name)
Creates a hierarchical property.

Parameters:
name - The hierarchical property name.
Method Detail

createRoot

public IlrHierarchicalPropertyNode createRoot(String rootName)
Creates a root and attaches it to the hierarchy.

Parameters:
rootName - The name of the root node.
Returns:
The created root node.

getName

public String getName()
Returns the name of the hierarchical property.

Returns:
The hierarchical property name.

addChildren

public void addChildren(String parentPath,
                        List children)
Adds the children contained in the list to a given parent node. The parent node can be either specified with its path from the root to the node or just by its name if the name is unique. The node path is computed as follows: in the following hierarchy:
   World {
     USA {
       California
     }
     Europe {
     }
   }
 
The California node is specified by the path World/USA/California. If the parent path or name does not lead to a node in the hierarchy, an IllegalArgumentException is thrown.

Parameters:
parentPath - The path from the root to the parent node or the parent node name.
children - The list of the child names to add to the parent node.

getNode

public IlrHierarchicalPropertyNode getNode(String id)
Returns the node in the hierarchy whose name is given as parameter. The name can be the path from the root to the researched node, or the name of the node itself. In some hierarchies, the node names may not be unique. In this case, null is returned.

Parameters:
id - The node identifier (may include a path from the root or just the node name)
Returns:
The node found in the hierarchy.

close

public void close()
Declares that the hierarchy definition is finished, in order to make some internal computation.


Rule Execution Server API

© Copyright IBM Corp. 1987, 2013