ilog.rules.dt.expression

Class ExpressionDefinition

    • Method Detail

      • getExpressionText

        public java.lang.String getExpressionText()
        Description copied from interface: IlrDTExpressionText
        Returns the expression text.

        For an IlrDTExpressionDefinition, the definition text is returned with placeholders.

        For an IlrDTExpressionInstance, the expression text is returned and the placeholders are replaced by expression parameter values.

        Specified by:
        getExpressionText in interface IlrDTExpressionText
        Returns:
        The expression text.
      • getErrorManager

        public IlrDTErrorManager getErrorManager()
        Description copied from class: ilog.rules.dt.expression.Expression
        This method returns the error manager associated to this expression
        Specified by:
        getErrorManager in interface IlrDTExpression
        Overrides:
        getErrorManager in class ilog.rules.dt.expression.Expression
        Returns:
        the error manager associated to the expression or a dummy error manager if not relevant for an expression
      • getLocalErrorManager

        public IlrDTErrorManager getLocalErrorManager()
        Description copied from interface: IlrDTExpressionDefinition
        Returns the error manager used to store errors local to this definition. The returned error manager does not contains errors concerning the expression placeholders.
        Specified by:
        getLocalErrorManager in interface IlrDTExpressionDefinition
        Returns:
        The local error manager. The returned value cannot be null.
      • getHolderNode

        public IlrSyntaxTree.Node getHolderNode()
        Description copied from interface: IlrDTExpressionDefinition
        Returns the syntax node corresponding to the holder role if this definition represents a top level sentence.
        Specified by:
        getHolderNode in interface IlrDTExpressionDefinition
        Returns:
        The syntax node of the holder role. If this definition does not represent a top level sentence, null is returned.
      • getPlaceHolders

        public java.util.List<IlrDTExpressionPlaceHolder> getPlaceHolders()
        Description copied from interface: IlrDTExpressionDefinition
        Returns the placeholders in this expression. Placeholders correspond to holes left in the definition expression. They are mapped to subcolumns in a decision table. Placeholder ordering matches the order in which they appear in the expression text.
        Specified by:
        getPlaceHolders in interface IlrDTExpressionDefinition
        Returns:
        The placeholder list. The list returned cannot be null.
      • getPlaceHolder

        public IlrDTExpressionPlaceHolder getPlaceHolder(int index)
        Description copied from interface: IlrDTExpressionDefinition
        Returns the placeholder at a specific position in this expression. Placeholders correspond to holes left in the definition expression. They are mapped to subcolumns in a decision table. Placeholder ordering matches the order in which they appear in the expression text.
        Specified by:
        getPlaceHolder in interface IlrDTExpressionDefinition
        Parameters:
        index - The location of the placeholder in this expression.
        Returns:
        The placeholder at index. If index is out of range, null is returned.
      • reset

        public boolean reset()
        Description copied from interface: IlrDTExpression
        Drops all references to vocabulary, and will requires parsing. Generally used when the context of the expression changes.
        Specified by:
        reset in interface IlrDTExpression
      • isExpressionValid

        public boolean isExpressionValid()
        Description copied from interface: IlrDTExpressionText
        Tests if the expression is valid. An expression is valid if it can be parsed against the current vocabulary without syntax error.

        The corresponding syntax tree for an invalid expression is either null or in error recovery.

        Specified by:
        isExpressionValid in interface IlrDTExpressionText
        Returns:
        If the expression is syntactically valid, true is returned.
      • clone

        public java.lang.Object clone()
        Creates and returns a copy of this expression.
        Specified by:
        clone in interface IlrDTExpression
        Specified by:
        clone in interface IlrDecorableElement
        Returns:
        A cloned copy of this expression containing its pattern and parameters.
      • cloneWithoutParameters

        public java.lang.Object cloneWithoutParameters()
        Creates and returns a copy of this expression. It clones the pattern, but not the parameters
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clone

        public IlrDTExpression clone(IlrDTContext context)
        Specified by:
        clone in interface IlrDTExpression
        Parameters:
        context - The context of the cloned expression.
        Returns:
        A copy of the expression attached to the given context.
      • getHolderText

        public java.lang.String getHolderText()
        Description copied from interface: IlrDTExpressionDefinition
        Returns the text of the holder role if this definition represents a top level sentence.
        Specified by:
        getHolderText in interface IlrDTExpressionDefinition
        Returns:
        The text of the holder role. If this definition does not represent a top level sentence, null is returned.
      • getParameterRole

        public IlrSyntacticRole getParameterRole(int index)
        Deprecated. 
        Specified by:
        getParameterRole in interface IlrDTExpressionSentence
        Parameters:
        index - tTe position of the parameter.
        Returns:
        The vocabulary syntactic roles of the parameter at position index.
      • getParameterRoleConcept

        public IlrConcept getParameterRoleConcept(int index)
        Deprecated. 
        Specified by:
        getParameterRoleConcept in interface IlrDTExpressionSentence
        Parameters:
        index - The position of the parameter.
        Returns:
        The vocabulary concept of the parameter at position index.
      • setHolderRoleText

        public void setHolderRoleText(java.lang.String text)
        Deprecated. 
        Description copied from interface: IlrDTExpressionSentence
        Defines the text of the holder expression.
        Specified by:
        setHolderRoleText in interface IlrDTExpressionSentence
        Parameters:
        text - The new text of the holder role expression.
      • setParameterRoleText

        public void setParameterRoleText(int index,
                                java.lang.String text)
        Deprecated. We assume if this is called on a definition it relates to a default value.
        Specified by:
        setParameterRoleText in interface IlrDTExpressionSentence
        Parameters:
        index - The position of the parameter.
        text - The new text of the parameter.
      • hasSyntacticErrors

        public boolean hasSyntacticErrors()
        Deprecated. 
        Description copied from interface: IlrDTExpressionText
        Check if the expression has syntactic errors. return True if the expression has syntactic errors.
        Specified by:
        hasSyntacticErrors in interface IlrDTExpressionText
      • accept

        public boolean accept(IlrDTExpressionRole holderRoleExpression)
        Deprecated. 
        Description copied from interface: IlrDTSentenceContext
        Tests if a holder role expression is compatible with this sentence context.
        Specified by:
        accept in interface IlrDTSentenceContext
        Parameters:
        holderRoleExpression - Holder role expression to test.
        Returns:
        True if the holder role expression is compatible with the sentence context, false otherwise.
      • convertParameterIndexToSentenceIndex

        public int convertParameterIndexToSentenceIndex(int parameterIndex)
        Deprecated. 
      • convertSentenceIndexToParameterIndex

        public int convertSentenceIndexToParameterIndex(int sentenceIndex)
        Deprecated. 
      • getExpressionSentenceRoleText

        public java.lang.String getExpressionSentenceRoleText(IlrDTExpressionRole expressionRole)
        Deprecated. 
      • getHolderRoleSentenceIndex

        public int getHolderRoleSentenceIndex()
        Deprecated. 
      • getParameterRoleConcepts

        public java.util.List getParameterRoleConcepts(IlrConcept hrConcept)
        Deprecated. 
      • getSentenceText

        public java.lang.String getSentenceText()
        Deprecated. 
        This method returns the text of the top level sentence with parameters and holder role as placeholders.
        Specified by:
        getSentenceText in interface IlrDTSentenceContext
        Returns:
        The template text of the sentence context. For example: <a number> is between <a number> and <a number>
      • setSentenceType

        public void setSentenceType(int type)
        Deprecated. 
      • setSentenceText

        public void setSentenceText(java.lang.String text)
        Deprecated. 
      • isValid

        public boolean isValid()
        Deprecated. 
        Specified by:
        isValid in interface IlrDTSentenceContext
        Returns:
        true if the sentence context is valid.
      • getSyntacticRole

        public IlrSyntacticRole getSyntacticRole(IlrDTExpressionPlaceHolder placeHolder)
        Description copied from interface: IlrDTExpressionDefinition
        Returns the syntactic role corresponding to the given placeholder. The syntactic role is returned if:
        • The expression definition represents a sentence.
        • This place-holder is mapped to a sentence role.
        Specified by:
        getSyntacticRole in interface IlrDTExpressionDefinition
        Parameters:
        placeHolder - The placeholder pointing to the part of the definition to check.
        Returns:
        The syntactic role. If the conditions are not met, null is returned.
      • equals

        public boolean equals(java.lang.Object o)
        Description copied from interface: IlrDTExpression
        Tests if two expressions are equal.
        Specified by:
        equals in interface IlrDTExpression
        Overrides:
        equals in class java.lang.Object
        Returns:
        True if the two given expressions are equal and false otherwise.

© Copyright IBM Corp. 1987, 2017