org.mmbase.storage.search.implementation
Class BasicFieldConstraint

java.lang.Object
  extended by org.mmbase.storage.search.implementation.BasicConstraint
      extended by org.mmbase.storage.search.implementation.BasicFieldConstraint
All Implemented Interfaces:
Serializable, Constraint, FieldConstraint
Direct Known Subclasses:
BasicFieldCompareConstraint, BasicFieldNullConstraint, BasicFieldValueBetweenConstraint, BasicFieldValueInConstraint, BasicFieldValueInQueryConstraint, BasicStringSearchConstraint

public class BasicFieldConstraint
extends BasicConstraint
implements FieldConstraint, Serializable

Basic implementation. The caseSensitive property defaults to true.

Since:
MMBase-1.7
Version:
$Id: BasicFieldConstraint.java 42627 2010-06-21 09:54:05Z michiel $
Author:
Rob van Maris
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.storage.search.implementation.BasicConstraint
modifiable
 
Constructor Summary
protected BasicFieldConstraint(StepField field)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Compares this constraint to the specified object.
 StepField getField()
          Gets the associated stepfield.
 String getFieldName()
          Returns the main field's fieldname, possibly extended with the step'sname if known.
 int hashCode()
           
 boolean isCaseSensitive()
          Tests if a the string comparison is case sensitive.
 boolean matches(Object o)
          Determines whether a certain given value would match this constraint.
 BasicFieldConstraint setCaseSensitive(boolean caseSensitive)
          Sets caseSensitive property.
 String toString()
           
 
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.Constraint
getBasicSupportLevel, isInverse, setUnmodifiable
 

Constructor Detail

BasicFieldConstraint

protected BasicFieldConstraint(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

setCaseSensitive

public BasicFieldConstraint setCaseSensitive(boolean caseSensitive)
Sets caseSensitive property. This has only effect when the associated field is of string type.

Parameters:
caseSensitive - The caseSensitive property value.
Returns:
This BasicFieldConstraint instance.

matches

public boolean matches(Object o)
Description copied from interface: FieldConstraint
Determines whether a certain given value would match this constraint.

Specified by:
matches in interface FieldConstraint

getField

public StepField getField()
Description copied from interface: FieldConstraint
Gets the associated stepfield.

Specified by:
getField in interface FieldConstraint

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: FieldConstraint
Tests if a the string comparison is case sensitive. This property is ignored if the associated field is not of string type.

Specified by:
isCaseSensitive in interface FieldConstraint

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 BasicConstraint
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 BasicConstraint

getFieldName

public String getFieldName()
Returns the main field's fieldname, possibly extended with the step'sname if known. May return null or partial fieldnames if not all data is available (for use in debugging).


toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null