Modifier and Type | Class and Description |
---|---|
static class |
TokenIterator.State
Experimental: contains an opaque iteration state that can be used to reposition a token iterator.
|
DEFAULT_POSITION_INCREMENT
Modifier | Constructor and Description |
---|---|
protected |
TokenIterator(TokenList tokens)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(Token t,
int increment)
Appends a token.
|
Token |
getNext()
Gets the next Token, without advancing the pointer.
|
int |
getNextPositionIncrement()
Returns the position increment for the next Token
|
int |
getPositionIncrement()
Returns the position increment for the current Token
|
TokenIterator.State |
getState()
Experimental: Get the current state of iteration.
|
boolean |
hasNext()
true if a next element exists |
Token |
next()
Moves the iterator to the next Token in the TokenList and returns that token.
|
void |
remove()
Removes the current Token from the TokenList
|
void |
restoreState(TokenIterator.State state)
Experimental: restore the state of iteration from
state . |
void |
saveState(TokenIterator.State state)
Experimental: save the current state of iteration to
state . |
void |
set(String t)
Replaces the current Token with a new Token
|
void |
set(Token t)
Replaces the current Token with a new Token
|
void |
setPositionIncrement(int increment)
Sets the position increment for the current Token
|
add, add, add, add, add, append, append, append, append, endScope, endScope, startLanguageRegion, startScope, startScope
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected TokenIterator(TokenList tokens)
public boolean hasNext()
true
if a next element existspublic Token next()
public Token getNext()
public int getNextPositionIncrement()
public int getPositionIncrement()
public void setPositionIncrement(int increment)
public void set(String t)
t
- The string value for the new Token to replace the current Tokenpublic void set(Token t)
t
- The Token to replace the current Token withpublic void add(Token t, int increment)
public void remove()
public TokenIterator.State getState()
NOTE: it is recommended that you create a minimal number of saved states.
States can be reused by calling saveState(State)
to save the current state
of iteration to an existing TokenIterator.State
instance.
public void saveState(TokenIterator.State state)
state
.public void restoreState(TokenIterator.State state)
state
.Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.