com.ibm.commerce.condition

Class OpenCondition

  • All Implemented Interfaces:
    com.ibm.commerce.base.helpers.Uniquifiable, ConditionConstants, com.ibm.commerce.datatype.Hashable, com.ibm.websphere.cache.Sizeable, java.io.Serializable


    public final class OpenCondition
    extends Condition
    implements com.ibm.commerce.base.helpers.Uniquifiable, java.io.Serializable, com.ibm.websphere.cache.Sizeable
    This class describes an open condition boolean expression. An open condition consists of a name and a set of parameters.
    See Also:
    Serialized Form
    • Field Detail

    • Constructor Detail

      • OpenCondition

        public OpenCondition(java.lang.String name)
        This constructor lets you specify the open condition name.
        Parameters:
        name - Open condition name.
      • OpenCondition

        public OpenCondition(java.lang.String name,
                             OpenCondition.Parameter parameter)
        This constructor lets you specify the open condition name and a single parameter.
        Parameters:
        name - Open condition name.
        parameter - Open condition parameter.
      • OpenCondition

        public OpenCondition(java.lang.String name,
                             OpenCondition.Parameter[] parameters)
        This constructor lets you specify the open condition name and an array of parameter objects.
        Parameters:
        name - Open condition name.
        parameters - An array of open condition parameter objects.
    • Method Detail

      • getObjectSize

        public long getObjectSize()
        Returns the estimated footprint size in bytes of this object and the objects it contains.
        Specified by:
        getObjectSize in interface com.ibm.websphere.cache.Sizeable
        Overrides:
        getObjectSize in class Condition
        Returns:
        the estimated footprint size in bytes or -1 if a size cannot be determined.
      • clone

        public java.lang.Object clone()
        Description copied from class: Condition
        Returns a clone of this condition object.
        Specified by:
        clone in class Condition
        Returns:
        A clone of this condition object.
      • getName

        public java.lang.String getName()
        Gets the name of the open condition.
        Returns:
        The name of the open condition.
      • setName

        public void setName(java.lang.String name)
        Sets the name of the open condition.
        Parameters:
        name - The name of the open condition.
      • getParameters

        public OpenCondition.Parameter[] getParameters()
        Gets the array of parameter objects.
        Returns:
        The array of parameter objects.
      • setParameters

        public void setParameters(OpenCondition.Parameter[] parameters)
        Sets the array of parameter objects.
        Parameters:
        parameters - An array of parameter objects.
      • evaluate

        public boolean evaluate(Evaluator evaluator)
        This method evaluates the open condition. The Evaluator implementation is called to evaluate the open condition. Note that the result will be negated if the not property is true.
        Specified by:
        evaluate in class Condition
        Parameters:
        evaluator - An implementation of the Evaluator interface that is used to evaluate the open conditions.
        Returns:
        true if the condition is true.
      • equals

        public boolean equals(java.lang.Object aObject)
        Returns true if the specified object is equivalent to this object.
        Overrides:
        equals in class Condition
        Parameters:
        aObject - the specified object.
        Returns:
        true if the specified object is equivalent to this object.
      • hashCode

        public int hashCode()
        Returns a hash code for this object. Equal objects must return the same hash code.
        Overrides:
        hashCode in class Condition
        Returns:
        the hash code.
      • uniquify

        public void uniquify()

        Reduces memory footprint of this object.

        It is expected that the implementation of this method will use the Uniquee class to replace some or all of its properties with equivalent values from the Uniquee cache, or, if equivalent values are not found, place this object's properties in the Uniquee cache.

        The caller must be able to promise that this object and its properties, recursively, will never be modified again, so that it and its properties can be shared by other objects.

        This method is intended to be called by the Uniquee class.

        Specified by:
        uniquify in interface com.ibm.commerce.base.helpers.Uniquifiable