WebObjects 5.2.3

com.webobjects.eocontrol
Class EOOrQualifier

java.lang.Object
  extended bycom.webobjects.eocontrol.EOQualifier
      extended bycom.webobjects.eocontrol.EOOrQualifier
All Implemented Interfaces:
EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, Serializable

public class EOOrQualifier
extends EOQualifier
implements NSCoding, EOKeyValueArchiving

EOOrQualifier is a subclass of EOQualifier that contains multiple qualifiers. EOOrQualifier implements the EOQualifierEvaluation interface, which defines the method evaluateWithObject for in-memory evaluation. When an EOOrQualifier object receives an evaluateWithObject message, it evaluates each of its qualifiers until one of them returns true. If one of its qualifiers returns true, the EOOrQualifier object returns true immediately.If all of its qualifiers return false, the EOOrQualifier object returns false.

See Also:
evaluateWithObject(Object object), Serialized Form

Nested Class Summary
 
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.Support
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOQualifier
QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual
 
Constructor Summary
EOOrQualifier(NSArray qualifiers)
          Creates and returns a new EOOrQualifier.
 
Method Summary
 void addQualifierKeysToSet(NSMutableSet qualKeys)
          Adds the receiver's qualifier keys to qualKeys.
 Class classForCoder()
          Allows the receiver to substitute a class other than its own (for example, a public superclass) for use during archiving (encoding) by an NSCoder.
static Object decodeObject(NSCoder coder)
          (Re)creates an object based on type information and data stored in coder.
static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
          Conforms to EOKeyValueArchiving.
 void encodeWithCoder(NSCoder coder)
          Archives the receiver's type information and data into coder.
 void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
          Conforms to EOKeyValueArchiving.
 boolean equals(Object other)
          If the receiver and the other object have equals qualifiers it returns true; false otherwise.
 boolean evaluateWithObject(Object object)
          Returns true if object satisfies the qualifier, false otherwise.
 NSArray qualifiers()
          The qualifiers contained in the receiver.
 EOQualifier qualifierWithBindings(NSDictionary bindings, boolean requiresAll)
          Returns a qualifier with the values associated by the bindings.
 String toString()
          String containing the description of all the qualifiers contained on receiver.
 void validateKeysWithRootClassDescription(EOClassDescription classDesc)
          Ensures that the receiver contains keys and key paths that belong to or originate from classDesc.
 
Methods inherited from class com.webobjects.eocontrol.EOQualifier
allQualifierKeys, allQualifierOperators, bindingKeys, clone, 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

EOOrQualifier

public EOOrQualifier(NSArray qualifiers)
Creates and returns a new EOOrQualifier. If qualifiers is provided, the EOOrQualifier is initialized with the qualifiers in qualifiers.

Parameters:
qualifiers - specifies qualifier
Method Detail

addQualifierKeysToSet

public void addQualifierKeysToSet(NSMutableSet qualKeys)
Adds the receiver's qualifier keys to qualKeys. EOOrQualifier does this by traversing the tree of qualifiers. Recursively it invokes this method until it reaches a leaf qualifier (such as EOKeyValueQualifier) which adds its key to the set.

Specified by:
addQualifierKeysToSet in class EOQualifier
Parameters:
qualKeys - the mutable array of qualifier keys

classForCoder

public Class classForCoder()
Allows the receiver to substitute a class other than its own (for example, a public superclass) for use during archiving (encoding) by an NSCoder. Default is the value of the getClass method.

Specified by:
classForCoder in interface NSCoding
Returns:
the Class to be used with an NSCoder
See Also:
encodeWithCoder(NSCoder coder), decodeObject(NSCoder coder), NSCoder, NSCoding

decodeObject

public static Object decodeObject(NSCoder coder)
(Re)creates an object based on type information and data stored in coder.

Parameters:
coder - stores object type information along with an object's data
Returns:
an object (re)created from the data in coder
See Also:
encodeWithCoder(NSCoder coder), NSCoder, NSCoding

decodeWithKeyValueUnarchiver

public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
Conforms to EOKeyValueArchiving.

Parameters:
unarchiver - the EOKeyValueArchiver object with which to decode the receiver
Returns:
the unarchived EOAndQualifier object

encodeWithCoder

public void encodeWithCoder(NSCoder coder)
Archives the receiver's type information and data into coder. The receiver can then be recreated using decodeObject. Custom type information can be used by overriding classForCoder.

Specified by:
encodeWithCoder in interface NSCoding
Parameters:
coder - stores object type information along with an object's data
See Also:
decodeObject(NSCoder coder), classForCoder(), NSCoder, NSCoding

encodeWithKeyValueArchiver

public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
Conforms to EOKeyValueArchiving.

Specified by:
encodeWithKeyValueArchiver in interface EOKeyValueArchiving
Parameters:
archiver - the EOKeyValueArchiver object with which to encode the receiver
See Also:
EOKeyValueArchiver

equals

public boolean equals(Object other)
If the receiver and the other object have equals qualifiers it returns true; false otherwise.

Returns:
true if both the receiver and the other object qualifiers are equal

evaluateWithObject

public boolean evaluateWithObject(Object object)
Returns true if object satisfies the qualifier, false otherwise. When an EOOrQualifier object receives an evaluateWithObject message, it evaluates each of its qualifiers until one of them returns true. If any of its qualifiers returns true, the EOOrQualifier object returns true immediately. If all of its qualifiers return false, the EOOrQualifier object returns false. This method can throw one of several possible exceptions if an error occurs. If application allows users to construct arbitrary qualifiers (such as through a user interface), user may want to write code to catch any exceptions and respond to errors (for example, by displaying a panel saying that the user typed a poorly formed qualifier).

Specified by:
evaluateWithObject in interface EOQualifierEvaluation
Overrides:
evaluateWithObject in class EOQualifier
Parameters:
object - specifies object which satisfies the qualifier
Returns:
returns true if anObject satisfies the qualifier, false otherwise

qualifierWithBindings

public EOQualifier qualifierWithBindings(NSDictionary bindings,
                                         boolean requiresAll)
Returns a qualifier with the values associated by the bindings. If requiresAll is true, any variable not found in bindings throws an exception. If requiresAll is false, missing variable values cause the qualifier node to be pruned from the tree.

Specified by:
qualifierWithBindings in class EOQualifier
Parameters:
bindings - the input array of values
requiresAll - true if all the value are required; otherwise false
Returns:
EOQualifier object with the values in the bindings array

qualifiers

public NSArray qualifiers()
The qualifiers contained in the receiver.

Returns:
the receiver's qualifiers

toString

public String toString()
String containing the description of all the qualifiers contained on receiver.

Returns:
String representation of the receiver

validateKeysWithRootClassDescription

public void validateKeysWithRootClassDescription(EOClassDescription classDesc)
Ensures that the receiver contains keys and key paths that belong to or originate from classDesc. This method raises an exception if an unknown key is found, otherwise it returns null to indicate that the keys contained by the qualifier are valid.

Specified by:
validateKeysWithRootClassDescription in class EOQualifier
Parameters:
classDesc - specifies class description

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.