WebObjects 5.4.2

com.webobjects.eocontrol
Class EOAndQualifier

java.lang.Object
  extended by com.webobjects.eocontrol.EOQualifier
      extended by com.webobjects.eocontrol.EOAndQualifier
All Implemented Interfaces:
EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, Serializable

public class EOAndQualifier
extends EOQualifier
implements NSCoding, EOKeyValueArchiving

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

See Also:
EOAndQualifier.evaluateWithObject(Object object), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOQualifier
EOQualifier.Comparison, EOQualifier.ComparisonSupport, EOQualifier.QualifierVariableSubstitutionException
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
NSCoding.Support
 
Nested classes/interfaces inherited from interface 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
EOAndQualifier(NSArray qualifiers)
          Creates a new EOAndQualifier.
 
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)
           
 boolean evaluateWithObject(Object object)
          When an EOAndQualifier object receives an evaluateWithObject message, it evaluates each of its qualifiers until one of them returns false.
 NSArray qualifiers()
          The qualifiers contained in the receiver.
 EOQualifier qualifierWithBindings(NSDictionary bindings, boolean requiresAll)
          If requiresAll is true, any variable not found in bindings throws an exception.
 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

EOAndQualifier

public EOAndQualifier(NSArray qualifiers)
Creates a new EOAndQualifier. If qualifiers is provided, the new EOAndQualifier is initialized with the objects in qualifiers.

Parameters:
qualifiers - immutable array of EOQualifier objects
Method Detail

qualifiers

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

Returns:
an NSArray of the receiver's qualifiers
See Also:
EOAndQualifier.EOAndQualifier(NSArray qualifiers)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

evaluateWithObject

public boolean evaluateWithObject(Object object)
When an EOAndQualifier object receives an evaluateWithObject message, it evaluates each of its qualifiers until one of them returns false. If any of its qualifiers returns false, the EOAndQualifier object returns false immediately. If all of its qualifiers return true, the object returns true. This method can throw several possible exceptions if an error occurs. If the application allows users to construct arbitrary qualifiers (such as through a user interface), you should write code to catch any exceptions and properly 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 - input object to be evaluated
Returns:
true if anObject satisfies the qualifier, false otherwise

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 qualifier contains valid keys.

Specified by:
validateKeysWithRootClassDescription in class EOQualifier
Parameters:
classDesc - the bridge between enterprise objects and the metadata contained in an external source of information

toString

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

Overrides:
toString in class Object
Returns:
String representation of the receiver

qualifierWithBindings

public EOQualifier qualifierWithBindings(NSDictionary bindings,
                                         boolean requiresAll)
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
Throws:
exception - when variable not found in bindings.

addQualifierKeysToSet

public void addQualifierKeysToSet(NSMutableSet qualKeys)
Adds the receiver's qualifier keys to qualKeys. The subclasses in the EOControl layer do this by traversing the tree of qualifiers. Node qualifiers (such as EOAndQualifier) recursively invoke this method until they reach a leaf qualifier (such as EOKeyValueQualifier) which adds its key to the set.

Subclasses of EOQualifier must implement this method.

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:
EOAndQualifier.encodeWithCoder(NSCoder coder), EOAndQualifier.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:
EOAndQualifier.encodeWithCoder(NSCoder coder), NSCoder, NSCoding

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:
EOAndQualifier.decodeObject(NSCoder coder), EOAndQualifier.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

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

Last updated June 2008

Copyright © 2000-2008 Apple Inc.