Modifier and Type | Method and Description |
---|---|
boolean |
canContinue(char c)
Determines if the current path can be continued with the given character.
|
boolean |
canGoBack()
Determines if the iterator can backtrack.
|
boolean |
doContinue(char c)
Tries to continue the current path with the given character.
|
Set<Character> |
getPossibilities()
Returns a set of all possible continuations for the current state of the iterator
|
V |
getValue()
Returns the value associated with the key represented by the path traversed so far.
|
void |
goBack()
Undoes the latest transition to support backtracking
|
boolean |
isCompleted()
Determines if the iterator is currently pointing at a valid match.
|
void |
reset()
Restarts the iterator at the beginning of the trie.
|
boolean |
resetWith(char c)
Restarts the iterator at the beginning and tries to perform the next transition using the given character.
|
void |
setValue(V value)
Sets the value to be associated with the key represented by the path traversed so far
|
boolean canContinue(char c)
This will not change the internal state.
c
- the character to continue withboolean doContinue(char c)
If the current path can be continued, the internal state will be updated. Otherwise the internal state will remain unchanged - the iterator is not reset automatically.
c
- the character to continue withV getValue()
void setValue(V value)
value
- the value to setboolean isCompleted()
boolean canGoBack()
void goBack()
Set<Character> getPossibilities()
void reset()
boolean resetWith(char c)
c
- the character to try to use after resetting the iteratorCopyright © 2018. All rights reserved.