Class Predicate

java.lang.Object
  |
  +--Predicate
Direct Known Subclasses:
CheckYes, ObjectPredicate

abstract class Predicate
extends java.lang.Object

The head of a hierarchy of classes that can evaluate conditions on objects. All the non-abstract classes in the hierarchy have names of the form CheckXxxx, where Xxxx is the predicate type passed in to RealObject.isPredicate. These classes logically belong as inner classes within RealObject, but as the names of the specific classes to instantiate are not determined until run time, they need to be instantiated using the Class.newInstance() method which is unable to create instances of inner classes (not that you could tell from the documentation).

See Also:
RealObject.isPredicate(java.lang.String)

Constructor Summary
(package private) Predicate()
           
 
Method Summary
abstract  boolean evaluate(RealObject ro, java.lang.String details)
          Evaluate a predicate on an object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Predicate

Predicate()
Method Detail

evaluate

public abstract boolean evaluate(RealObject ro,
                                 java.lang.String details)
Evaluate a predicate on an object. For example, is this object in the ballroom?
Parameters:
ro - the object on which we want to evaluate the predicate.
details - further details used in a subclass-specific manner
Returns:
whether the object does indeed satisfy the specified predicate