Package org.bct.api
Class NestedTokenizer.Token
java.lang.Object
org.bct.api.NestedTokenizer.Token
- Enclosing class:
- NestedTokenizer
Represents a parsed token with optional nested sub-tokens.
A Token contains a string value and may have nested tokens representing the content inside braces. Tokens support deep nesting for complex hierarchical structures.
Structure:
- value: The main token value (part before any braces)
- nested: Optional list of nested tokens (content within braces)
Examples:
"foo" →Token{value="foo", nested=null} "foo{a,b}" →Token{value="foo", nested=[Token{value="a"}, Token{value="b"}]}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns an unmodifiable view of the nested tokens.getValue()Returns the main value of this token.inthashCode()booleanReturns true if this token has nested content.(package private) voidsetNested(List<NestedTokenizer.Token> nested) Sets the nested tokens for this token (package-private for tokenizer use).toString()
-
Constructor Details
-
Token
Creates a new token with the specified value.- Parameters:
value- The token value
-
-
Method Details
-
getValue
Returns the main value of this token.- Returns:
- The token value
-
hasNested
public boolean hasNested()Returns true if this token has nested content.- Returns:
- true if nested tokens exist
-
getNested
Returns an unmodifiable view of the nested tokens.- Returns:
- unmodifiable list of nested tokens, or empty list if none
-
setNested
Sets the nested tokens for this token (package-private for tokenizer use).- Parameters:
nested- The list of nested tokens
-
toString
-
equals
-
hashCode
public int hashCode()
-