org.shapelogic.predicate
Class NamedPredicateDecorator<T>

java.lang.Object
  extended by org.shapelogic.predicate.NamedPredicateDecorator<T>
Type Parameters:
E -
All Implemented Interfaces:
NamedPredicate<T>, Predicate<T>, OHInterface

public class NamedPredicateDecorator<T>
extends java.lang.Object
implements NamedPredicate<T>

NamedPredicate is a predicate with and OH name, Object Hypothesis name.
This is used for XOR or OnePredicate. You want to know what predicate that was satisfied.

Author:
Sami Badawi

Field Summary
protected  java.lang.String _ohName
           
protected  Predicate<T> _predicate
           
 
Constructor Summary
NamedPredicateDecorator(Predicate<T> predicate, java.lang.String ohName)
           
 
Method Summary
 boolean evaluate(T input)
          Checks if a binary predicate relation holds.
 java.lang.String getOhName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_predicate

protected final Predicate<T> _predicate

_ohName

protected final java.lang.String _ohName
Constructor Detail

NamedPredicateDecorator

public NamedPredicateDecorator(Predicate<T> predicate,
                               java.lang.String ohName)
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>

getOhName

public java.lang.String getOhName()
Specified by:
getOhName in interface OHInterface


Copyright © 2009. All Rights Reserved.