public class TokenValue
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE_BRACKET_CLOSE
Value type: bracket close.
|
static java.lang.String |
TYPE_BRACKET_OPEN
Value type: bracket open.
|
static java.lang.String |
TYPE_DOUBLE_QUOTE_TEXT
Value type: text, enfolded by double quotes.
|
static java.lang.String |
TYPE_NUMBER
Value type: number
|
static java.lang.String |
TYPE_TEXT
Value type: text (without white spaces).
|
Constructor and Description |
---|
TokenValue(java.lang.String token)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
double |
getValueAsDouble()
Get the token value as double.
|
java.lang.String |
getValueAsText()
Get the token value as text.
|
java.lang.String |
getValueType()
Get the value type.
|
boolean |
isBracketClose()
Get if the value type is TYPE_BRACKET_CLOSE.
|
boolean |
isBracketOpen()
Get if the value type is TYPE_BRACKET_OPEN.
|
boolean |
isDoubleQuoteText()
Get if the value type is TYPE_DOUBLE_QUOTE_TEXT.
|
boolean |
isNumber()
Get if the value type is TYPE_NUMBER.
|
boolean |
isText()
Get if the value type is TYPE_TEXT.
|
public static final java.lang.String TYPE_BRACKET_OPEN
public static final java.lang.String TYPE_BRACKET_CLOSE
public static final java.lang.String TYPE_TEXT
public static final java.lang.String TYPE_DOUBLE_QUOTE_TEXT
public static final java.lang.String TYPE_NUMBER
public TokenValue(java.lang.String token)
token
- the tokenpublic java.lang.String getValueType()
TYPE_BRACKET_OPEN
,
TYPE_BRACKET_CLOSE
,
TYPE_NUMBER
,
TYPE_TEXT
,
TYPE_DOUBLE_QUOTE_TEXT
public boolean isBracketOpen()
TYPE_BRACKET_OPEN
public boolean isBracketClose()
TYPE_BRACKET_CLOSE
public boolean isNumber()
TYPE_NUMBER
public boolean isText()
TYPE_TEXT
public boolean isDoubleQuoteText()
TYPE_DOUBLE_QUOTE_TEXT
public java.lang.String getValueAsText()
public double getValueAsDouble() throws InterpreterException
InterpreterException
- if the value type is not TYPE_NUMBERgetValueType()
,
TYPE_NUMBER