Class JBBPToken
java.lang.Object
com.igormaznitsa.jbbp.compiler.tokenizer.JBBPToken
- All Implemented Interfaces:
Serializable
The Class describes a token from parsed script.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet numeric representation of the array size.Get the array size value in its raw form.Get the field name of the value represented by the token,Get the field type parameters.intGet the token position value in the stringgetType()Get the token type.booleanisArray()Check that the token is array.booleanCheck that the toke is commentaries.booleanCheck that the array is not fixed size one.toString()
-
Method Details
-
getPosition
public int getPosition()Get the token position value in the string- Returns:
- the position value, the first char is 0. If the value is negative one then the position is undefined.
-
getType
Get the token type.- Returns:
- get the token type.
- See Also:
-
getFieldName
Get the field name of the value represented by the token,- Returns:
- the field name as string or null if the field doesn't have defined field name.
-
getFieldTypeParameters
Get the field type parameters.- Returns:
- the field type parameters
-
isArray
public boolean isArray()Check that the token is array.- Returns:
- true if the token represents an array, false otherwise
-
isComment
public boolean isComment()Check that the toke is commentaries.- Returns:
- true if the token represents commentaries, false otherwise
-
isVarArrayLength
public boolean isVarArrayLength()Check that the array is not fixed size one.- Returns:
- true if the field represents a non-fixed size array
-
getArraySizeAsString
Get the array size value in its raw form.- Returns:
- the array size value as string, if the field is not an array then null.
-
getArraySizeAsInt
Get numeric representation of the array size.- Returns:
- the parsed numeric representation of the array size value or null if it can't be parsed
- Throws:
NullPointerException- will be thrown if the array size value is null
-
toString
-