ilog.rules.factory

Class IlrHierarchicalProperty

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


    public class IlrHierarchicalProperty
    extends java.lang.Object
    implements ilog.rules.factory.IlrHierarchicalPropertyElement, java.io.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

      Constructors 
      Constructor and Description
      IlrHierarchicalProperty(java.lang.String name)
      Creates a hierarchical property.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void addChildren(java.lang.String parentPath, java.util.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(java.lang.String rootName)
      Creates a root and attaches it to the hierarchy.
      java.lang.String getName()
      Returns the name of the hierarchical property.
      IlrHierarchicalPropertyNode getNode(java.lang.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(java.lang.String name)
        Creates a hierarchical property.
        Parameters:
        name - The hierarchical property name.
    • Method Detail

      • createRoot

        public IlrHierarchicalPropertyNode createRoot(java.lang.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 java.lang.String getName()
        Returns the name of the hierarchical property.
        Returns:
        The hierarchical property name.
      • addChildren

        public void addChildren(java.lang.String parentPath,
                       java.util.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(java.lang.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.

© Copyright IBM Corp. 1987, 2017