Interface Predicate

All Known Implementing Classes:

public interface Predicate

An algorithm that computes a Boolean result from configuration parameters and a Configuration.Selector. A When object uses a Predicate to identify use cases to which configuration items apply: nested configuration items are used if and only if Predicate.evaluate returns true.

Method Summary
 void configure(Unmarshaller parent, XMLThing source)
          Set configuration parameters.
 boolean evaluate(Configuration.Selector selector)
          Determine whether this predicate is true for the given selector.

Method Detail


public void configure(Unmarshaller parent,
                      XMLThing source)
Set configuration parameters. This method need not be thread-safe.

parent - a handle on the When that contains this Predicate.
source - configuration parameters (as XML conditions)


public boolean evaluate(Configuration.Selector selector)
Determine whether this predicate is true for the given selector. This method must be thread-safe; that is, when called concurrently by multiple threads, the value returned to each thread must be independent of the threads' order of execution. This is ordinarily achieved by not modifying any objects.