Package com.attivio.sdk.token
Class TokenSink
- java.lang.Object
-
- com.attivio.sdk.token.TokenSink
-
- Direct Known Subclasses:
TokenIterator,TokenList
public abstract class TokenSink extends java.lang.ObjectAbstract class for objects that can have tokens added to them.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_POSITION_INCREMENTDefault position increment (1).
-
Constructor Summary
Constructors Constructor Description TokenSink()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(Token t)Appends a token using the default position increment.voidadd(TokenList tokens)Adds all Tokens for the passed in TokenList to this TokenList.voidadd(TokenList tokens, int increment)Adds all Tokens for the passed in TokenListabstract voidadd(Token t, int increment)Appends a token.voidadd(java.lang.String t)Appends a token using the default position increment.voidadd(java.lang.String t, int increment)Appends a token.TokenSinkappend(Token t)Appends a token using the default position increment.TokenSinkappend(Token t, int increment)Appends a token.TokenSinkappend(java.lang.String t)Appends a token to this TokenList using the default position increment.TokenSinkappend(java.lang.String t, int increment)Appends a token.voidendScope(java.lang.String name)Add anTokenAnnotation.SCOPE_ENDtoken to the token list.voidendScope(java.lang.String name, int endOffset)Add anTokenAnnotation.SCOPE_ENDtoken to the token list.TokenstartLanguageRegion(java.util.Locale locale)Start a language region forlocale.voidstartScope(java.lang.String name)Add anTokenAnnotation.SCOPE_STARTtoken to the token list.voidstartScope(java.lang.String name, int startOffset)Add aTokenAnnotation.SCOPE_STARTtoken to the token list.
-
-
-
Field Detail
-
DEFAULT_POSITION_INCREMENT
protected static final int DEFAULT_POSITION_INCREMENT
Default position increment (1).- See Also:
- Constant Field Values
-
-
Method Detail
-
startScope
public void startScope(java.lang.String name)
Add anTokenAnnotation.SCOPE_STARTtoken to the token list.
-
startScope
public void startScope(java.lang.String name, int startOffset)Add aTokenAnnotation.SCOPE_STARTtoken to the token list.
-
startLanguageRegion
public Token startLanguageRegion(java.util.Locale locale)
Start a language region forlocale.A
nulllocalewill be encoded as an empty string.- Since:
- 5.5.0 patch 95
-
endScope
public void endScope(java.lang.String name)
Add anTokenAnnotation.SCOPE_ENDtoken to the token list.
-
endScope
public void endScope(java.lang.String name, int endOffset)Add anTokenAnnotation.SCOPE_ENDtoken to the token list.
-
add
public final void add(java.lang.String t)
Appends a token using the default position increment.- Parameters:
t- The string value of a Token to add
-
add
public final void add(java.lang.String t, int increment)Appends a token.- Parameters:
t- The string value of a Token to addincrement- The position increment for the newly added token
-
add
public final void add(Token t)
Appends a token using the default position increment.- Parameters:
t- The Token to add to this TokenList
-
add
public abstract void add(Token t, int increment)
Appends a token.- Parameters:
t- The Token to addincrement- The position increment for the newly added token
-
add
public final void add(TokenList tokens)
Adds all Tokens for the passed in TokenList to this TokenList.The first Token copied from the passed in TokenList will have the default position increment in this TokenList.
NOTE: The tokens in the passed in TokenList will be cloned prior to adding to this TokenList. Modifications to the passed in TokenList after calling add(TokenList) will not impact this TokenList.
- Parameters:
tokens- The TokenList to copy onto the end of this TokenList.
-
add
public void add(TokenList tokens, int increment)
Adds all Tokens for the passed in TokenListNOTE: The tokens in the passed in TokenList will be cloned prior to being added. Modifications to the passed in TokenList after calling add(TokenList) will not impact this TokenSink.
- Parameters:
tokens- The TokenList to add.increment- The increment for the first Token added fromtokens
-
append
public TokenSink append(java.lang.String t)
Appends a token to this TokenList using the default position increment.- Parameters:
t- The string value of a Token to add to this TokenList- Returns:
this(supports call chaining)
-
append
public TokenSink append(java.lang.String t, int increment)
Appends a token.- Parameters:
t- The string value of a Token to addincrement- The position increment for the Token to add- Returns:
this(supports call chaining)
-
append
public TokenSink append(Token t)
Appends a token using the default position increment.- Parameters:
t- The Token to add- Returns:
this(supports call chaining)
-
-