ilog.rules.factory

Class IlrCastValue

  • All Implemented Interfaces:
    java.io.Serializable


    public final class IlrCastValue
    extends IlrValue
    This class represents a cast expression of the rule language. A cast transforms a value with a certain type to another value of another type, when the cast is permitted. The cast operation is performed by a IlrUnaryOperator, which is determined using the type of the argument. The method getOperator() returns that operator. If this method returns null, it means that the cast expression is not valid.

    Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of IBM Decision Server.

    See Also:
    Serialized Form
    • Constructor Detail

      • IlrCastValue

        public IlrCastValue(java.lang.Class clazz,
                    IlrValue value)
        Constructs a cast expression.
        Parameters:
        clazz - The class to which the value will be casted.
        value - The value to cast.
      • IlrCastValue

        public IlrCastValue(IlrType type,
                    IlrValue value)
        Constructs a cast expression. The type to which the expression is casted is a BOM type.
        Parameters:
        type - The type to which the value is casted.
        value - The value to cast.
    • Method Detail

      • getValue

        public IlrValue getValue()
        Gets the value to which the cast is applied.
        Returns:
        The value to which the cast is applied.
      • getClassName

        public java.lang.String getClassName()
        Gets the fully qualified class name for the class to which the cast is made.
        Returns:
        The fully qualified class name for the class to which the cast is made.
      • getShortClassName

        public java.lang.String getShortClassName()
        Gets the short class name for the class to which the cast is made.
        Returns:
        The short class name for the class to which the cast is made.
      • getOperator

        public IlrUnaryOperator getOperator()
        Determines and returns the unary operator used to perform the cast. This is done using the type of the argument. If this method returns null, the cast expression is not valid.
        Returns:
        A unary operator, or null if the cast is not valid.
      • isTautology

        public boolean isTautology()
        Indicates whether the cast value tries to cast a value to its own type.
        Since:
        JRules 6.0
        Returns:
        true if the type of the argument is the same as the cast type.
      • getCustomOperator

        public IlrUnaryOperator getCustomOperator()
        Returns the user-defined operator that overloads this cast, if any.
        Since:
        JRules 6.0
        Returns:
        The user-defined operator that overloads this cast, or null if the operator for this cast is not overloaded by the user.
      • exploreValue

        public java.lang.Object exploreValue(IlrFactoryExplorer explorer)
        Explores the cast value using a factory explorer and returns an object as a result.
        Specified by:
        exploreValue in class IlrValue
        Parameters:
        explorer - The factory explorer.
        Returns:
        An object which represents the result of the exploration, or null if the method does not return a value.

© Copyright IBM Corp. 1987, 2017