org.mmbase.storage.search.implementation
Class BasicFieldCompareConstraint

java.lang.Object
  extended by org.mmbase.storage.search.implementation.BasicConstraint
      extended by org.mmbase.storage.search.implementation.BasicFieldConstraint
          extended by org.mmbase.storage.search.implementation.BasicFieldCompareConstraint
All Implemented Interfaces:
Serializable, Constraint, FieldCompareConstraint, FieldConstraint
Direct Known Subclasses:
BasicCompareFieldsConstraint, BasicFieldValueConstraint

public class BasicFieldCompareConstraint
extends BasicFieldConstraint
implements FieldCompareConstraint, Serializable

Basic implementation. The tested operation is equality, unless it is explicitly set.

Since:
MMBase-1.7
Version:
$Id: BasicFieldCompareConstraint.java 41969 2010-04-20 11:54:02Z michiel $
Author:
Rob van Maris
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.storage.search.implementation.BasicConstraint
modifiable
 
Fields inherited from interface org.mmbase.storage.search.FieldCompareConstraint
EQUAL, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LIKE, NOT_EQUAL, OPERATOR_DESCRIPTIONS, REGEXP
 
Constructor Summary
protected BasicFieldCompareConstraint(StepField field)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Compares this constraint to the specified object.
 int getOperator()
          Gets the operator used to compare values.
 String getOperatorDescription()
          Returns a description of the operator
 int hashCode()
           
 BasicFieldCompareConstraint setOperator(int operator)
          Sets operator.
 String toString()
           
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicFieldConstraint
getField, getFieldName, isCaseSensitive, matches, setCaseSensitive
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicConstraint
getBasicSupportLevel, isInverse, setInverse, setUnmodifiable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.FieldConstraint
getField, isCaseSensitive, matches
 
Methods inherited from interface org.mmbase.storage.search.Constraint
getBasicSupportLevel, isInverse, setUnmodifiable
 

Constructor Detail

BasicFieldCompareConstraint

protected BasicFieldCompareConstraint(StepField field)
Constructor. Protected, so only subclasses can be instantiated.

Parameters:
field - The associated field.
Throws:
IllegalArgumentException - when an invalid argument is supplied.
Method Detail

setOperator

public BasicFieldCompareConstraint setOperator(int operator)
Sets operator.

Parameters:
operator - the operator value
Returns:
This BasicFieldCompareConstraint instance.
Throws:
IllegalArgumentException - when an invalid argument is supplied.

getOperator

public int getOperator()
Description copied from interface: FieldCompareConstraint
Gets the operator used to compare values. This must be one of the values declared here. The value LIKE is allowed only when the associated field is of string type.

Specified by:
getOperator in interface FieldCompareConstraint

getOperatorDescription

public String getOperatorDescription()
Returns a description of the operator


equals

public boolean equals(Object obj)
Description copied from interface: Constraint
Compares this constraint to the specified object. The result is true if and only if the argument is a non-null Constraint object representing the same constraint(s).

Specified by:
equals in interface Constraint
Overrides:
equals in class BasicFieldConstraint
Parameters:
obj - The object to compare with.
Returns:
true if the objects are equal, false otherwise.

hashCode

public int hashCode()
Specified by:
hashCode in interface Constraint
Overrides:
hashCode in class BasicFieldConstraint

toString

public String toString()
Overrides:
toString in class BasicFieldConstraint


MMBase 2.0-SNAPSHOT - null