org.mmbase.storage.search.implementation
Class BasicFieldValueDateConstraint

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.BasicConstraint
      extended byorg.mmbase.storage.search.implementation.BasicFieldConstraint
          extended byorg.mmbase.storage.search.implementation.BasicFieldCompareConstraint
              extended byorg.mmbase.storage.search.implementation.BasicFieldValueConstraint
                  extended byorg.mmbase.storage.search.implementation.BasicFieldValueDateConstraint
All Implemented Interfaces:
Constraint, FieldCompareConstraint, FieldConstraint, FieldValueConstraint, FieldValueDateConstraint

public class BasicFieldValueDateConstraint
extends BasicFieldValueConstraint
implements FieldValueDateConstraint

A constraint on a 'part' of a DateTime field. E.g. where extract(YEAR, lastmodified) = 2004.

Since:
MMBase-1.8
Version:
$Id: BasicFieldValueDateConstraint.java,v 1.5 2005/07/08 12:23:45 pierre Exp $
Author:
Michiel Meeuwissen

Field Summary
 
Fields inherited from interface org.mmbase.storage.search.FieldValueDateConstraint
CENTURY, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, HOUR, MILLISECOND, MINUTE, MONTH, PART_DESCRIPTIONS, QUARTER, SECOND, WEEK, YEAR
 
Fields inherited from interface org.mmbase.storage.search.FieldCompareConstraint
EQUAL, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, LIKE, NOT_EQUAL, OPERATOR_DESCRIPTIONS
 
Constructor Summary
BasicFieldValueDateConstraint(StepField field, Object value, int part)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Compares this constraint to the specified object.
 int getPart()
          Returns the part of the date-field wich is to be compared.
 String getPartDescription()
          Returns a description of the part
 int hashCode()
           
 void setPart(int p)
           
 String toString()
          Returns a string representation of this FieldValueConstraint.
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicFieldValueConstraint
getValue, setValue
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicFieldCompareConstraint
getOperator, getOperatorDescription, setOperator
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicFieldConstraint
getField, getFieldName, isCaseSensitive, setCaseSensitive
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicConstraint
getBasicSupportLevel, isInverse, setInverse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.FieldValueConstraint
getValue
 
Methods inherited from interface org.mmbase.storage.search.FieldCompareConstraint
getOperator
 
Methods inherited from interface org.mmbase.storage.search.FieldConstraint
getField, isCaseSensitive
 
Methods inherited from interface org.mmbase.storage.search.Constraint
getBasicSupportLevel, isInverse
 

Constructor Detail

BasicFieldValueDateConstraint

public BasicFieldValueDateConstraint(StepField field,
                                     Object value,
                                     int part)
Constructor. Depending on the field type, the value must be of type String or Number.

Parameters:
field - The associated field.
value - The non-null property value.
part - Which part of the date to compare
Throws:
IllegalArgumentException - when an invalid argument is supplied.
Method Detail

getPart

public int getPart()
Description copied from interface: FieldValueDateConstraint
Returns the part of the date-field wich is to be compared.

Specified by:
getPart in interface FieldValueDateConstraint

getPartDescription

public String getPartDescription()
Returns a description of the part


setPart

public void setPart(int p)

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 BasicFieldValueConstraint

hashCode

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

toString

public String toString()
Description copied from interface: FieldValueConstraint
Returns a string representation of this FieldValueConstraint. The string representation has the form "FieldValueConstraint(inverse:<:inverse>, field:<field>, casesensitive:<casesensitive>, operator:<operator>, value:<value>)" where

Specified by:
toString in interface FieldValueConstraint
Overrides:
toString in class BasicFieldValueConstraint


MMBase build 1.8.1.20060716