edu.stanford.nlp.ling.tokensregex.types
Class ValueFunctions.CompareFunction<T>

java.lang.Object
  extended by edu.stanford.nlp.ling.tokensregex.types.ValueFunctions.NamedValueFunction
      extended by edu.stanford.nlp.ling.tokensregex.types.ValueFunctions.CompareFunction<T>
All Implemented Interfaces:
ValueFunction
Enclosing class:
ValueFunctions

public static class ValueFunctions.CompareFunction<T>
extends ValueFunctions.NamedValueFunction


Field Summary
 
Fields inherited from class edu.stanford.nlp.ling.tokensregex.types.ValueFunctions.NamedValueFunction
name, signature
 
Constructor Summary
ValueFunctions.CompareFunction(java.lang.String name, java.util.Comparator<T> comparator, ValueFunctions.CompareType compType, java.lang.Class clazz)
           
 
Method Summary
 Value apply(Env env, java.util.List<Value> in)
          Applies the function to the list values using the environment as context and returns the evaluated value.
 boolean checkArgs(java.util.List<Value> in)
          Checks if the arguments are valid
 java.lang.Boolean compare(T o1, T o2)
           
 
Methods inherited from class edu.stanford.nlp.ling.tokensregex.types.ValueFunctions.NamedValueFunction
getParamDesc, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueFunctions.CompareFunction

public ValueFunctions.CompareFunction(java.lang.String name,
                                      java.util.Comparator<T> comparator,
                                      ValueFunctions.CompareType compType,
                                      java.lang.Class clazz)
Method Detail

compare

public java.lang.Boolean compare(T o1,
                                 T o2)

checkArgs

public boolean checkArgs(java.util.List<Value> in)
Description copied from interface: ValueFunction
Checks if the arguments are valid

Returns:
true if the arguments are valid (false otherwise)

apply

public Value apply(Env env,
                   java.util.List<Value> in)
Description copied from interface: ValueFunction
Applies the function to the list values using the environment as context and returns the evaluated value.

Parameters:
env - the environment to use
in - the input arguments
Returns:
Value indicating the value of the function


Stanford NLP Group