ilog.rules.factory

Class IlrPackageFactory

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


    public class IlrPackageFactory
    extends java.lang.Object
    implements java.io.Serializable, ilog.rules.factory.IlrPackageElement
    This class models a package in the IRL language. A package may contain local variables, rules, functions, and tasks. Each artifact contained in a package has a short name which is the artifact definition name and a fully qualified name which is the definition name prefixed with the package name.

    Artifacts defined in a given package are visible in another package either if they are referenced with their fully qualified name or if their package is imported into the package that uses the artifacts.

    Since:
    JRules 6.0
    See Also:
    Serialized Form
    • Field Detail

      • name

        public java.lang.String name
        This field is the name of the package.
      • formalComment

        public java.lang.String formalComment
        This field contains the formal comment of the package.
    • Method Detail

      • isDefaultPackage

        public boolean isDefaultPackage()
        Indicates whether this is the default package (whose name is the empty string) or not.
        Specified by:
        isDefaultPackage in interface ilog.rules.factory.IlrPackageElement
        Returns:
        true if this is the default package, else it returns false
      • getReflect

        public final IlrReflect getReflect()
        Gets the reflect object.
        Returns:
        The reflect object of this package factory.
      • getInitialActions

        public final IlrStatement[] getInitialActions()
        Deprecated. 
        Gets the actions of the initialization rule.
        Returns:
        The actions of the initialization rule, or null if no initial rule has been created.
      • getVariable

        public IlrVariable getVariable(java.lang.String name)
        Returns the variable that implements the variable whose name is passed as a parameter.
        Parameters:
        name - The name of the variable we are looking for.
      • getVariables

        public java.util.Vector getVariables()
        Returns the variables defined in the package. The variables are modelled with IlrVariable objects. The returned vector is empty in case no variable is defined in the package.
        Specified by:
        getVariables in interface ilog.rules.factory.IlrPackageElement
        Returns:
        A vector that contains the variables defined in the package.
      • addRule

        public void addRule(IlrRuleFactory rule)
        Adds a rule to the rules of the package. The rule is placed at the end of the rules.
        Parameters:
        rule - The rule to be added.
      • getRule

        public IlrRuleFactory getRule(java.lang.String name)
        Gets a rule factory by name.
        Parameters:
        name - The name of the rule factory.
        Returns:
        A rule factory object whose name is name. When name is null, a null object is returned.
      • getRules

        public final IlrRuleFactory[] getRules()
        Gets the rules of this package.
        Returns:
        The rules of this package.
      • getTasks

        public IlrTaskFactory[] getTasks()
        Returns an array with the tasks defined in the package.
        Returns:
        An array with the package's tasks.
      • addTask

        public void addTask(IlrTaskFactory task)
        Adds a task to the tasks of the ruleset. The task is placed at the end of the tasks.
        Parameters:
        task - The task to be added.
      • getTask

        public final IlrTaskFactory getTask(java.lang.String name)
        Gets a task factory by name.
        Parameters:
        name - The name of the task factory.
        Returns:
        A task factory object whose name is name. When name is null, a null object is returned.
      • addFunction

        public void addFunction(IlrFunctionFactory function)
        Adds a function in the package.
        Parameters:
        function - The function added into the package.
      • getFunctions

        public final IlrFunctionFactory[] getFunctions()
        Gets the functions of this package.
        Returns:
        The functions of this package.
      • enumerateFunctions

        public final java.util.Enumeration enumerateFunctions()
        Gets an enumeration to visit all the functions of this package.
        Returns:
        An enumeration to visit all the functions of this package.

© Copyright IBM Corp. 1987, 2017