com.ibm.commerce.component.bod

Class VerbStepPredicate

  • java.lang.Object
    • com.ibm.commerce.component.bod.VerbStepPredicate
  • Direct Known Subclasses:
    VerbStepAttributeEqualPredicate, VerbStepIndexPredicate


    public abstract class VerbStepPredicate
    extends java.lang.Object
    Represents a predicate of a VerbPathStep. A predicate can be used to filter out nodes. When a node in a graph is to be accessed, only the nodes whose predicates are true will be accessed.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASS_NAME
      Name of this class
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      VerbStepPredicate(java.lang.String aVariableName, java.lang.Object aVariableValue) 
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o)
      Compares this instance with a given instance.
      abstract boolean evaluate(java.lang.Object node)
      Computes whether the predicate is true against the given node
      java.lang.String getSymbol() 
      java.lang.String getVariableName() 
      java.lang.Object getVariableValue() 
      int hashCode()
      Returns a hash value for an instance of VerbAction
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        Name of this class
    • Constructor Detail

      • VerbStepPredicate

        public VerbStepPredicate(java.lang.String aVariableName,
                                 java.lang.Object aVariableValue)
        Parameters:
        aVariableName - The name of the predicate variable. Since a predicate can be null, the name can be null.
        aVariableValue - The value of the predicate.
    • Method Detail

      • getSymbol

        public java.lang.String getSymbol()
        Returns:
        The operator symbol of the predicate, such as =, >, >=, and <=
      • evaluate

        public abstract boolean evaluate(java.lang.Object node)
        Computes whether the predicate is true against the given node
        Parameters:
        node - the node that will be tested against the predicate
        Returns:
        true if the node satisfies the predicate. False otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of the predicate
      • getVariableName

        public java.lang.String getVariableName()
        Returns:
        the name of predicate variable
      • getVariableValue

        public java.lang.Object getVariableValue()
        Returns:
        the expected value of the predicate
      • equals

        public final boolean equals(java.lang.Object o)
        Compares this instance with a given instance. Object.equals(java.lang.Object)
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the object to be compared with
        Returns:
        true if the given object is a predicate and contains the same variable name, the same variable value, and the same symbol
      • hashCode

        public int hashCode()
        Returns a hash value for an instance of VerbAction
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash value for an instance of VerbAction