edu.stanford.nlp.ling.tokensregex.types
Class Expressions.SimpleValue<T>

java.lang.Object
  extended by edu.stanford.nlp.ling.tokensregex.types.Expressions.TypedExpression
      extended by edu.stanford.nlp.ling.tokensregex.types.Expressions.SimpleValue<T>
Type Parameters:
T -
All Implemented Interfaces:
Expression, Value<T>, java.io.Serializable
Direct Known Subclasses:
Expressions.PrimitiveValue, Expressions.RegexValue
Enclosing class:
Expressions

public static class Expressions.SimpleValue<T>
extends Expressions.TypedExpression
implements Value<T>

Simple implementation of Value backed by a java object of type T

See Also:
Serialized Form

Constructor Summary
protected Expressions.SimpleValue(java.lang.String typename, T value, java.lang.String... tags)
           
 
Method Summary
 Value evaluate(Env env, java.lang.Object... args)
          Evaluates the expression using the specified environment and arguments.
 T get()
          The Java object representing the value of the expressions
 boolean hasValue()
          Returns whether the expression has already been evaluated to a Value
 java.lang.String toString()
           
 
Methods inherited from class edu.stanford.nlp.ling.tokensregex.types.Expressions.TypedExpression
getTags, getType, setTags, simplify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.nlp.ling.tokensregex.types.Expression
getTags, getType, setTags, simplify
 

Constructor Detail

Expressions.SimpleValue

protected Expressions.SimpleValue(java.lang.String typename,
                                  T value,
                                  java.lang.String... tags)
Method Detail

get

public T get()
Description copied from interface: Value
The Java object representing the value of the expressions

Specified by:
get in interface Value<T>
Returns:
a Java object

evaluate

public Value evaluate(Env env,
                      java.lang.Object... args)
Description copied from interface: Expression
Evaluates the expression using the specified environment and arguments. Arguments are additional context not provided by the environment.

Specified by:
evaluate in interface Expression
Returns:
Evaluated value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasValue

public boolean hasValue()
Description copied from interface: Expression
Returns whether the expression has already been evaluated to a Value

Specified by:
hasValue in interface Expression
Overrides:
hasValue in class Expressions.TypedExpression
Returns:
True if the expression is already evaluated


Stanford NLP Group