Package com.igormaznitsa.jcp.expression
Class Value
- java.lang.Object
-
- com.igormaznitsa.jcp.expression.Value
-
- All Implemented Interfaces:
ExpressionItem
public final class Value extends java.lang.Object implements ExpressionItem
The class describes an expression value i.e. an atomic constant expression item like string or number- See Also:
ValueType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
asBoolean()
java.lang.Float
asFloat()
java.lang.Long
asLong()
java.lang.String
asString()
boolean
equals(java.lang.Object var)
ExpressionItemPriority
getExpressionItemPriority()
Get the priority of the itemExpressionItemType
getExpressionItemType()
Get the type of the itemValueType
getType()
java.lang.Object
getValue()
static java.lang.Object
getValue(java.lang.String value, ValueType type)
int
hashCode()
static Value
recognizeOf(java.lang.String str)
static Value
recognizeRawString(java.lang.String str)
static ValueType
recognizeType(java.lang.String value)
java.lang.String
toString()
java.lang.String
toStringDetail()
static Value
valueOf(java.lang.Boolean val)
static Value
valueOf(java.lang.Float val)
static Value
valueOf(java.lang.Long val)
static Value
valueOf(java.lang.String val)
-
-
-
Field Detail
-
BOOLEAN_TRUE
public static final Value BOOLEAN_TRUE
-
BOOLEAN_FALSE
public static final Value BOOLEAN_FALSE
-
INT_ZERO
public static final Value INT_ZERO
-
INT_ONE
public static final Value INT_ONE
-
INT_TWO
public static final Value INT_TWO
-
INT_THREE
public static final Value INT_THREE
-
INT_FOUR
public static final Value INT_FOUR
-
INT_FIVE
public static final Value INT_FIVE
-
value
private final java.lang.Object value
-
type
private final ValueType type
-
-
Method Detail
-
getType
public ValueType getType()
-
getValue
public java.lang.Object getValue()
-
valueOf
public static Value valueOf(java.lang.Long val)
-
valueOf
public static Value valueOf(java.lang.Boolean val)
-
valueOf
public static Value valueOf(java.lang.Float val)
-
valueOf
public static Value valueOf(java.lang.String val)
-
asLong
public java.lang.Long asLong()
-
asFloat
public java.lang.Float asFloat()
-
asString
public java.lang.String asString()
-
asBoolean
public java.lang.Boolean asBoolean()
-
recognizeRawString
public static Value recognizeRawString(java.lang.String str)
-
recognizeOf
public static Value recognizeOf(java.lang.String str)
-
getValue
public static java.lang.Object getValue(java.lang.String value, ValueType type)
-
recognizeType
public static ValueType recognizeType(java.lang.String value)
-
toStringDetail
public java.lang.String toStringDetail()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getExpressionItemType
public ExpressionItemType getExpressionItemType()
Description copied from interface:ExpressionItem
Get the type of the item- Specified by:
getExpressionItemType
in interfaceExpressionItem
- Returns:
- the item type, must not be null
-
getExpressionItemPriority
public ExpressionItemPriority getExpressionItemPriority()
Description copied from interface:ExpressionItem
Get the priority of the item- Specified by:
getExpressionItemPriority
in interfaceExpressionItem
- Returns:
- the item priority, must not be null
-
equals
public boolean equals(java.lang.Object var)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-