org.shapelogic.predicate
Class OnePredicate<T>

java.lang.Object
  extended by org.shapelogic.predicate.CompositePredicate<T>
      extended by org.shapelogic.predicate.OnePredicate<T>
Type Parameters:
T -
All Implemented Interfaces:
Predicate<T>
Direct Known Subclasses:
OnePredicateSelector

public class OnePredicate<T>
extends CompositePredicate<T>

One component predicates have to be true.
Same functionality as OnePredicate in Apache Commons.
This is an Exclusive OR operation.

Author:
Sami Badawi

Field Summary
 
Fields inherited from class org.shapelogic.predicate.CompositePredicate
_predicates
 
Constructor Summary
OnePredicate(Predicate<T>[] predicates)
           
 
Method Summary
 boolean evaluate(T input)
          Checks if a binary predicate relation holds.
 
Methods inherited from class org.shapelogic.predicate.CompositePredicate
getPredicates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnePredicate

public OnePredicate(Predicate<T>[] predicates)
Method Detail

evaluate

public boolean evaluate(T input)
Description copied from interface: Predicate
Checks if a binary predicate relation holds.

Specified by:
evaluate in interface Predicate<T>
Specified by:
evaluate in class CompositePredicate<T>


Copyright © 2008. All Rights Reserved.