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.BooleanasBoolean()java.lang.FloatasFloat()java.lang.LongasLong()java.lang.StringasString()booleanequals(java.lang.Object var)ExpressionItemPrioritygetExpressionItemPriority()Get the priority of the itemExpressionItemTypegetExpressionItemType()Get the type of the itemValueTypegetType()java.lang.ObjectgetValue()static java.lang.ObjectgetValue(java.lang.String value, ValueType type)inthashCode()static ValuerecognizeOf(java.lang.String str)static ValuerecognizeRawString(java.lang.String str)static ValueTyperecognizeType(java.lang.String value)java.lang.StringtoString()java.lang.StringtoStringDetail()static ValuevalueOf(java.lang.Boolean val)static ValuevalueOf(java.lang.Float val)static ValuevalueOf(java.lang.Long val)static ValuevalueOf(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:
toStringin classjava.lang.Object
-
getExpressionItemType
public ExpressionItemType getExpressionItemType()
Description copied from interface:ExpressionItemGet the type of the item- Specified by:
getExpressionItemTypein interfaceExpressionItem- Returns:
- the item type
-
getExpressionItemPriority
public ExpressionItemPriority getExpressionItemPriority()
Description copied from interface:ExpressionItemGet the priority of the item- Specified by:
getExpressionItemPriorityin interfaceExpressionItem- Returns:
- the item priority, must not be null
-
equals
public boolean equals(java.lang.Object var)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-