Project Wonder 2.0

er.extensions
Class ERXBetweenQualifier

java.lang.Object
  extended bycom.webobjects.eocontrol.EOQualifier
      extended bycom.webobjects.eocontrol.EOKeyValueQualifier
          extended byer.extensions.ERXBetweenQualifier
All Implemented Interfaces:
Cloneable, EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, Serializable

public class ERXBetweenQualifier
extends EOKeyValueQualifier
implements EOQualifierEvaluation, Cloneable

The between qualifier allows qualification on an attribute that is between two values. This qualifier supports both in-memory and sql based qualification. The SQL generated is of the form: "FOO BETWEEN 1 AND 3" Note this qualifier supports qualifing against String, Number and NSTimestamp values.

See Also:
Serialized Form

Nested Class Summary
static class ERXBetweenQualifier.BetweenQualifierSQLGenerationSupport
           
 
Nested classes inherited from class com.webobjects.eocontrol.EOQualifier
EOQualifier.Comparison, EOQualifier.ComparisonSupport, EOQualifier.QualifierVariableSubstitutionException
 
Nested classes inherited from class com.webobjects.foundation.NSCoding
NSCoding._BigDecimalSupport, NSCoding._BigIntegerSupport, NSCoding._BooleanSupport, NSCoding._ByteSupport, NSCoding._CharacterSupport, NSCoding._DateSupport, NSCoding._DoubleSupport, NSCoding._FloatSupport, NSCoding._IntegerSupport, NSCoding._LongSupport, NSCoding._NumberSupport, NSCoding._ShortSupport, NSCoding._StringSupport, NSCoding.Support
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving._NullValueSupport, EOKeyValueArchiving._NumberSupport, EOKeyValueArchiving._TimestampSupport, EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOKeyValueQualifier
_CLASS, _lowercaseCache, _selector, _value
 
Fields inherited from class com.webobjects.eocontrol.EOQualifier
QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual
 
Fields inherited from interface com.webobjects.eocontrol.EOQualifierEvaluation
_CLASS
 
Constructor Summary
ERXBetweenQualifier(String aKey, Object aMinimumValue, Object aMaximumValue)
          Creates a qualifier for a given key with a min and max value specified.
 
Method Summary
 void addQualifierKeysToSet(NSMutableSet aSet)
          Adds the qualification key of the qualifier to the given set.
 Object clone()
          Implementation of the Clonable interface.
protected  NSComparator comparatorForObject(Object anObject)
          Determines the comparator to use for a given object based on the object's class.
 boolean evaluateWithObject(Object anObject)
          Compares an object to determine if it is within the between qualification of the current qualifier.
 String key()
          Gets the key to qualify against.
 Object maximumValue()
          Gets the maximum value.
 Object minimumValue()
          Gets the minimum value.
 EOQualifier qualifierWithBindings(NSDictionary someBindings, boolean requiresAll)
          Creates another qualifier after replacing the values of the bindings.
 void setKey(String aValue)
          Sets the qualification key.
 void setMaximumValue(Object aValue)
          Sets the maximum value.
 void setMinimumValue(Object aValue)
          Sets the minimum value.
 void validateKeysWithRootClassDescription(EOClassDescription aClassDescription)
          This qualifier does not perform validation.
 
Methods inherited from class com.webobjects.eocontrol.EOKeyValueQualifier
_accept, classForCoder, decodeObject, decodeWithKeyValueUnarchiver, encodeWithCoder, encodeWithKeyValueArchiver, equals, selector, toString, value
 
Methods inherited from class com.webobjects.eocontrol.EOQualifier
_isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERXBetweenQualifier

public ERXBetweenQualifier(String aKey,
                           Object aMinimumValue,
                           Object aMaximumValue)
Creates a qualifier for a given key with a min and max value specified.

Parameters:
aKey - key to qualify against
aMinimumValue - minimum value of the key
aMaximumValue - maximum value of the key
Method Detail

key

public String key()
Gets the key to qualify against.

Returns:
qualifier key

setKey

public void setKey(String aValue)
Sets the qualification key.

Parameters:
aValue - for the qualification key.

minimumValue

public Object minimumValue()
Gets the minimum value.

Returns:
minimum value.

setMinimumValue

public void setMinimumValue(Object aValue)
Sets the minimum value.

Parameters:
aValue - new minimum value

maximumValue

public Object maximumValue()
Gets the maximum value.

Returns:
maximum value.

setMaximumValue

public void setMaximumValue(Object aValue)
Sets the maximum value.

Parameters:
aValue - new maximum value

addQualifierKeysToSet

public void addQualifierKeysToSet(NSMutableSet aSet)
Adds the qualification key of the qualifier to the given set.

Parameters:
aSet - to add the qualification key to.

qualifierWithBindings

public EOQualifier qualifierWithBindings(NSDictionary someBindings,
                                         boolean requiresAll)
Creates another qualifier after replacing the values of the bindings. Since this qualifier does not support qualifier binding keys a clone of the qualifier is returned.

Parameters:
someBindings - some bindings
requiresAll - tells if the qualifier requires all bindings
Returns:
clone of the current qualifier.

validateKeysWithRootClassDescription

public void validateKeysWithRootClassDescription(EOClassDescription aClassDescription)
This qualifier does not perform validation. This is a no-op method.

Parameters:
aClassDescription - to validation the qualifier keys against.

comparatorForObject

protected NSComparator comparatorForObject(Object anObject)
Determines the comparator to use for a given object based on the object's class.

Parameters:
anObject - to find the comparator for
Returns:
comparator to use when comparing objects of a given class.

evaluateWithObject

public boolean evaluateWithObject(Object anObject)
Compares an object to determine if it is within the between qualification of the current qualifier. This method is only used for in-memory qualification.

Specified by:
evaluateWithObject in interface EOQualifierEvaluation
Returns:
if the given object is within the boundries of the qualifier.

clone

public Object clone()
Implementation of the Clonable interface.

Returns:
clone of the qualifier

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.