java.lang.Object
com.maroontress.clione.impl.Case
The mapping of one or more characters to a tokenizer.
Note that the Case
instance is an immutable object.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The function that that takes a character and returns a tokenizer associated with the character. -
Method Summary
Modifier and TypeMethodDescriptionReturns the unmodifiable set of characters that this case maps.Returns the tokenizer that this case maps characters to.static Case.Mapper
Returns a new mapping function that takes a character and returns a tokenizer associated with the character with the specified cases.static Case
Returns a new case that starts with the specified character and has the specified tokenizer.static Case
Returns a new case that starts with the specified character and that one of the specified cases may follow.static Case
Returns a new case that starts with the specified character and that one of the specified cases may follow.static Case
Returns a new case that maps the specified character set to the specified tokenizer.static Case
Returns a new case that starts with one of characters in the specified set and that one of the specified cases may follow it.
-
Method Details
-
getCharSet
Returns the unmodifiable set of characters that this case maps.- Returns:
- The unmodifiable set of characters.
-
getTokenizer
Returns the tokenizer that this case maps characters to.- Returns:
- The tokenizer.
-
of
Returns a new case that starts with the specified character and has the specified tokenizer.- Parameters:
c
- The character that the case starts with.tokenizer
- The tokenizer associated with the case.- Returns:
- The new case.
-
of
Returns a new case that maps the specified character set to the specified tokenizer.- Parameters:
set
- The set of characters to maptokenizer
- The tokenizer to map characters to.- Returns:
- The new case.
-
of
Returns a new case that starts with the specified character and that one of the specified cases may follow.- Parameters:
c
- The character that the case starts with.otherwise
- The token type that the tokenizer returns when none of the specified cases follows the characterc
.cases
- The cases that may follow the characterc
.- Returns:
- The new case.
-
of
Returns a new case that starts with the specified character and that one of the specified cases may follow.- Parameters:
c
- The character that the case starts with.otherwise
- The tokenizer returns when none of the specified cases follows the characterc
.cases
- The cases that may follow the characterc
.- Returns:
- The new case.
-
of
Returns a new case that starts with one of characters in the specified set and that one of the specified cases may follow it.- Parameters:
set
- The set of characters, one of which the case starts with.otherwise
- The token type that the tokenizer returns when none of the specified cases follows the one of the characters.cases
- The cases that may follow one of the characters.- Returns:
- The new case.
-
newMapper
Returns a new mapping function that takes a character and returns a tokenizer associated with the character with the specified cases.- Parameters:
cases
- The cases.- Returns:
- The new map.
-