ilog.rules.brl.translation

Class IlrSimpleBindingStatement

  • All Implemented Interfaces:
    IlrNamedStatement, java.io.Serializable


    public class IlrSimpleBindingStatement
    extends IlrBindingStatement
    This class defines simple bindings.

    Current predefined simple binding kinds include:

    1. the 'class' kind which represents a class binding.
    2. the 'collect' kind which represents a collection binding.
    3. the 'not' kind which represents 'not' binding.
    4. the 'exists' kind which represents an existing binding.
    5. the 'evaluate' kind which represents an 'evaluate' statement (not to be mistaken with an IlrEvaluateStatement).
    6. the CUSTOM_EXTENSION kind which allows users to add their own kind of simple bindings.

    If users wish to add a new kind of simple binding, they should use a kind starting from constant CUSTOM_EXTENSION.

    See Also:
    Serialized Form
    • Field Detail

      • CLASS

        public static final int CLASS
        Constant for class binding (value is 0).
        See Also:
        Constant Field Values
      • COLLECT

        public static final int COLLECT
        Constant for collect binding (value is 1).
        See Also:
        Constant Field Values
      • EXISTS

        public static final int EXISTS
        Constant for exists binding (value is 3).
        See Also:
        Constant Field Values
      • EVALUATE

        public static final int EVALUATE
        Constant for evaluate statement (value is 4).
        See Also:
        Constant Field Values
      • CUSTOM_EXTENSION

        public static final int CUSTOM_EXTENSION
        Constant for simple binding extensions (value is 10).
        See Also:
        Constant Field Values
    • Constructor Detail

      • IlrSimpleBindingStatement

        public IlrSimpleBindingStatement(IlrSyntaxTree.Node node)
        Builds a simple binding statement from the specified node.
        Parameters:
        node - The node.
      • IlrSimpleBindingStatement

        public IlrSimpleBindingStatement(IlrSyntaxTree.Node node,
                                 java.lang.String varName)
        Builds a simple binding from the specified node using the specified varName as the name of binding.
        Parameters:
        node - The node.
        varName - The name of the binding.
      • IlrSimpleBindingStatement

        public IlrSimpleBindingStatement(IlrSyntaxTree.Node node,
                                 java.lang.String varName,
                                 IlrConcept concept)
        Builds a simple binding from the specified node, using the specified varName, as the name of binding, and concept as the concept type.
        Parameters:
        node - The node.
        varName - The name of the binding.
        concept - The concept type of the binding.
    • Method Detail

      • setConcept

        public void setConcept(IlrConcept concept)
        Sets the concept type of this binding. It is mandatory to provide the concept to a simple binding, except for 'evaluate' simple bindings.
      • getConcept

        public IlrConcept getConcept()
        Gets the concept of this simple binding statement.
        Returns:
        The concept type of this simple binding statement.
      • setKind

        public void setKind(int kind)
        Sets the kind of this simple binding statement.
        Parameters:
        kind - The new kind.
      • getKind

        public int getKind()
        Gets the kind of this simple binding statement.
        Returns:
        The kind of this statement.
      • setFromSyntaxNode

        public void setFromSyntaxNode(IlrSyntaxTree.Node fromSyntaxNode)
        Sets the node that designates the 'from' statement of the simple binding. This node is optional.
        Parameters:
        fromSyntaxNode - The node designating the 'from' statement.
      • setInSyntaxNode

        public void setInSyntaxNode(IlrSyntaxTree.Node inSyntaxNode)
        Sets the node that designates the 'in' statement of the simple binding. This node is optional.
        Parameters:
        inSyntaxNode - The node designating the 'in' statement.
      • getFromSyntaxNode

        public IlrSyntaxTree.Node getFromSyntaxNode()
        Gets the node designating the 'from' statement of the simple binding.
        Returns:
        The node designating the 'from' statement.
      • getInSyntaxNode

        public IlrSyntaxTree.Node getInSyntaxNode()
        Gets the node designating the 'in' statement of the simple binding.
        Returns:
        The node designating the 'in' statement.
      • getOriginNode

        public IlrSyntaxTree.Node getOriginNode()
        Gets the node designating the 'from' statement or the 'in' statement of the simple binding.
        Returns:
        a syntax node
      • hasInSyntaxNode

        public boolean hasInSyntaxNode()
        Returns true if this binding has a node designating a 'from' statement.
        Returns:
        true if this binding has a node designating a 'from' statement.
      • hasFromSyntaxNode

        public boolean hasFromSyntaxNode()
        Returns true if this binding has a node designating a 'in' statement.
        Returns:
        true if this binding has a node designating a 'in' statement.
      • hasOriginSyntaxNode

        public boolean hasOriginSyntaxNode()
        Returns true if this binding has a node designating a 'from' or a 'in' statement.
        Returns:
        true if this binding has a node designating a 'from' or a 'in' statement.
      • getWhereSyntaxNode

        public IlrSyntaxTree.Node getWhereSyntaxNode()
        Gets the node designating the 'where' tests of the simple binding.
        Returns:
        The node designating the 'where' tests.
      • setWhereSyntaxNode

        public void setWhereSyntaxNode(IlrSyntaxTree.Node node)
        Sets the node designating the 'where' tests of the simple binding. This node is optional.
        Parameters:
        node - The node designating the 'where' tests.

© Copyright IBM Corp. 1987, 2017