edu.stanford.nlp.ling.tokensregex.types
Class Expressions

java.lang.Object
  extended by edu.stanford.nlp.ling.tokensregex.types.Expressions

public class Expressions
extends java.lang.Object

Various implementations of the Expression interface

Author:
Angel Chang

Nested Class Summary
static class Expressions.AndExpression
           
static class Expressions.AssignableFunctionCallExpression
          A function call that can be assigned a value.
static class Expressions.CaseExpression
           
static class Expressions.CompositeValue
          A composite value with field names and values for each field
static class Expressions.ConditionalExpression
           
static class Expressions.FieldExpression
           
static class Expressions.FunctionCallExpression
           
static class Expressions.IfExpression
           
static class Expressions.IndexedExpression
           
static class Expressions.ListExpression
           
static class Expressions.MethodCallExpression
           
static class Expressions.NotExpression
           
static class Expressions.OrExpression
           
static class Expressions.PrimitiveValue<T>
          Primitive value that is directly represented by a Java object of type T
static class Expressions.RegexMatchResultVarExpression
           
static class Expressions.RegexMatchVarExpression
           
static class Expressions.RegexValue
          A string that represents a regular expression
static class Expressions.SimpleCachedExpression<T>
          A simple implementation of an expression that is represented by a java object of type T and which also has a cached Value stored with it
static class Expressions.SimpleExpression<T>
          A simple implementation of an expression that is represented by a java object of type T
static class Expressions.SimpleValue<T>
          Simple implementation of Value backed by a java object of type T
static class Expressions.TypedExpression
          An expression with a typename and tags
static class Expressions.VarAssignmentExpression
          A variable assignment with the name of the variable, and the expression to assign to that variable
static class Expressions.VarExpression
          A variable, which can be assigned any expression.
static class Expressions.WrappedExpression
          An expression that is a wrapper around another expression
 
Field Summary
static Value<java.lang.Boolean> FALSE
           
protected static java.lang.String NEWLINE
           
static Value NIL
           
static Value<java.lang.Boolean> TRUE
           
static java.lang.String TYPE_ANNOTATION_KEY
           
static java.lang.String TYPE_BOOLEAN
           
static java.lang.String TYPE_CLASS
          CLASS - Maps to a Java class
static java.lang.String TYPE_COMPOSITE
          COMPOSITE - Composite value with field names and field values
static java.lang.String TYPE_FUNCTION
          FUNCTION - (input) => (output) where input is a list of Values, and output is a single Value
static java.lang.String TYPE_LIST
          LIST - List
static java.lang.String TYPE_NUMBER
          NUMBER - Numeric value (can be integer or real)
static java.lang.String TYPE_REGEX
          REGEX - Regular expression pattern (for tokens or string)
static java.lang.String TYPE_REGEXMATCHVAR
          REGEXMATCHVAR - Variable that refers to variable resulting from a regex match or used in a regex match (starts with $)
static java.lang.String TYPE_SET
           
static java.lang.String TYPE_STRING
          STRING - String
static java.lang.String TYPE_STRING_REGEX
           
static java.lang.String TYPE_TOKEN_REGEX
           
static java.lang.String TYPE_TOKENS
           
static java.lang.String TYPE_VAR
          VAR - Variable
 
Constructor Summary
Expressions()
           
 
Method Summary
static Expression asExpression(Env env, java.lang.Object v)
           
static
<C> C
asObject(Env env, java.lang.Object v)
           
static Value asValue(Env env, java.lang.Object v)
           
static java.lang.Boolean convertValueToBoolean(Value v, boolean keepNull)
           
static Value<java.lang.Boolean> convertValueToBooleanValue(Value v, boolean keepNull)
           
static
<T> Value
createValue(java.lang.String typename, T value, java.lang.String... tags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_VAR

public static final java.lang.String TYPE_VAR
VAR - Variable

See Also:
Constant Field Values

TYPE_FUNCTION

public static final java.lang.String TYPE_FUNCTION
FUNCTION - (input) => (output) where input is a list of Values, and output is a single Value

See Also:
Constant Field Values

TYPE_REGEX

public static final java.lang.String TYPE_REGEX
REGEX - Regular expression pattern (for tokens or string)

See Also:
Constant Field Values

TYPE_STRING_REGEX

public static final java.lang.String TYPE_STRING_REGEX
See Also:
Constant Field Values

TYPE_TOKEN_REGEX

public static final java.lang.String TYPE_TOKEN_REGEX
See Also:
Constant Field Values

TYPE_REGEXMATCHVAR

public static final java.lang.String TYPE_REGEXMATCHVAR
REGEXMATCHVAR - Variable that refers to variable resulting from a regex match or used in a regex match (starts with $)

See Also:
Constant Field Values

TYPE_STRING

public static final java.lang.String TYPE_STRING
STRING - String

See Also:
Constant Field Values

TYPE_NUMBER

public static final java.lang.String TYPE_NUMBER
NUMBER - Numeric value (can be integer or real)

See Also:
Constant Field Values

TYPE_COMPOSITE

public static final java.lang.String TYPE_COMPOSITE
COMPOSITE - Composite value with field names and field values

See Also:
Constant Field Values

TYPE_LIST

public static final java.lang.String TYPE_LIST
LIST - List

See Also:
Constant Field Values

TYPE_SET

public static final java.lang.String TYPE_SET
See Also:
Constant Field Values

TYPE_ANNOTATION_KEY

public static final java.lang.String TYPE_ANNOTATION_KEY
See Also:
Constant Field Values

TYPE_CLASS

public static final java.lang.String TYPE_CLASS
CLASS - Maps to a Java class

See Also:
Constant Field Values

TYPE_TOKENS

public static final java.lang.String TYPE_TOKENS
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final java.lang.String TYPE_BOOLEAN
See Also:
Constant Field Values

TRUE

public static final Value<java.lang.Boolean> TRUE

FALSE

public static final Value<java.lang.Boolean> FALSE

NIL

public static final Value NIL

NEWLINE

protected static final java.lang.String NEWLINE
Constructor Detail

Expressions

public Expressions()
Method Detail

convertValueToBoolean

public static java.lang.Boolean convertValueToBoolean(Value v,
                                                      boolean keepNull)

convertValueToBooleanValue

public static Value<java.lang.Boolean> convertValueToBooleanValue(Value v,
                                                                  boolean keepNull)

asObject

public static <C> C asObject(Env env,
                             java.lang.Object v)

asExpression

public static Expression asExpression(Env env,
                                      java.lang.Object v)

asValue

public static Value asValue(Env env,
                            java.lang.Object v)

createValue

public static <T> Value createValue(java.lang.String typename,
                                    T value,
                                    java.lang.String... tags)


Stanford NLP Group