org.botlibre.sdk.util
Class TextStream
java.lang.Object
org.botlibre.sdk.util.TextStream
public class TextStream
- extends java.lang.Object
Provides a useful text stream class.
Constructor Summary |
TextStream(java.lang.String text)
|
Method Summary |
java.util.List<java.lang.String> |
allWords()
|
boolean |
atEnd()
|
boolean |
atStart()
|
void |
backup()
|
void |
backup(int count)
|
void |
backupTo(char token)
|
void |
backupTo(char token,
boolean including)
|
void |
backupToAll(java.lang.String tokens)
|
void |
backupToAll(java.lang.String tokens,
boolean including)
|
void |
backupToAny(java.lang.String tokens)
|
void |
backupToAny(java.lang.String tokens,
boolean including)
|
void |
backupWhitespace()
|
java.util.List<java.lang.String> |
csv()
|
char |
current()
|
java.lang.String |
currentLine()
|
int |
currentLineColumn()
|
int |
currentLineNumber()
|
int |
getPosition()
|
java.lang.String |
getText()
|
boolean |
isWordSymbol(char character)
|
char |
last()
|
char |
next()
|
java.lang.String |
next(int count)
|
java.lang.String |
nextLine()
|
java.lang.String |
nextQuotes()
|
java.lang.String |
nextQuotesExcludeDoubleQuote()
|
java.lang.String |
nextSentence()
|
java.lang.String |
nextWhitespace()
|
java.lang.String |
nextWord()
|
char |
peek()
|
java.lang.String |
peek(int count)
|
int |
peekCodePoint()
|
char |
peekPrevious()
|
java.lang.String |
peekPreviousWord()
|
java.lang.String |
peekWord()
|
char |
previous()
|
java.lang.String |
previous(int count)
|
void |
reset()
|
void |
setPosition(int index)
|
void |
skip()
|
void |
skip(int count)
|
void |
skipBrackets()
|
void |
skipLine()
|
void |
skipQuotes()
|
void |
skipTo(char token)
|
boolean |
skipTo(char token,
boolean including)
|
void |
skipToAll(java.lang.String tokens)
|
boolean |
skipToAll(java.lang.String tokens,
boolean including)
|
void |
skipToAny(java.lang.String tokens)
|
void |
skipToAny(java.lang.String tokens,
boolean including)
|
boolean |
skipWhitespace()
|
void |
skipWord()
|
java.lang.String |
toString()
|
java.lang.String |
upTo(char token)
|
java.lang.String |
upTo(char token,
boolean including)
|
java.lang.String |
upTo(char token,
boolean including,
boolean resetIfNotFound)
|
java.lang.String |
upToAll(java.lang.String tokens)
|
java.lang.String |
upToAll(java.lang.String tokens,
boolean including)
|
java.lang.String |
upToAll(java.lang.String tokens,
boolean including,
boolean resetIfNotFound)
|
java.lang.String |
upToAny(java.lang.String tokens)
|
java.lang.String |
upToAny(java.lang.String tokens,
boolean including)
|
java.lang.String |
upToEnd()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
WHITESPACE
public static final java.lang.String WHITESPACE
- See Also:
- Constant Field Values
HTTP
public static final java.lang.String HTTP
- See Also:
- Constant Field Values
TOKENS
public static final java.lang.String TOKENS
- See Also:
- Constant Field Values
TERMINATORS
public static final java.lang.String TERMINATORS
- See Also:
- Constant Field Values
ABBREVIATIONS
public static java.util.Set<java.lang.String> ABBREVIATIONS
IGNORABLE
public static java.util.Set<java.lang.String> IGNORABLE
TextStream
public TextStream(java.lang.String text)
reset
public void reset()
last
public char last()
current
public char current()
peekPrevious
public char peekPrevious()
peek
public char peek()
peekCodePoint
public int peekCodePoint()
next
public char next()
previous
public char previous()
skip
public void skip()
skip
public void skip(int count)
backup
public void backup(int count)
backup
public void backup()
peek
public java.lang.String peek(int count)
previous
public java.lang.String previous(int count)
next
public java.lang.String next(int count)
atEnd
public boolean atEnd()
atStart
public boolean atStart()
upTo
public java.lang.String upTo(char token)
skipTo
public void skipTo(char token)
upToEnd
public java.lang.String upToEnd()
upTo
public java.lang.String upTo(char token,
boolean including)
upTo
public java.lang.String upTo(char token,
boolean including,
boolean resetIfNotFound)
skipTo
public boolean skipTo(char token,
boolean including)
backupTo
public void backupTo(char token)
backupTo
public void backupTo(char token,
boolean including)
upToAny
public java.lang.String upToAny(java.lang.String tokens)
upToAny
public java.lang.String upToAny(java.lang.String tokens,
boolean including)
skipToAny
public void skipToAny(java.lang.String tokens)
skipToAny
public void skipToAny(java.lang.String tokens,
boolean including)
upToAll
public java.lang.String upToAll(java.lang.String tokens)
upToAll
public java.lang.String upToAll(java.lang.String tokens,
boolean including)
upToAll
public java.lang.String upToAll(java.lang.String tokens,
boolean including,
boolean resetIfNotFound)
skipToAll
public void skipToAll(java.lang.String tokens)
skipToAll
public boolean skipToAll(java.lang.String tokens,
boolean including)
backupToAll
public void backupToAll(java.lang.String tokens)
backupToAll
public void backupToAll(java.lang.String tokens,
boolean including)
backupToAny
public void backupToAny(java.lang.String tokens)
backupToAny
public void backupToAny(java.lang.String tokens,
boolean including)
peekWord
public java.lang.String peekWord()
allWords
public java.util.List<java.lang.String> allWords()
csv
public java.util.List<java.lang.String> csv()
peekPreviousWord
public java.lang.String peekPreviousWord()
isWordSymbol
public boolean isWordSymbol(char character)
nextQuotes
public java.lang.String nextQuotes()
nextQuotesExcludeDoubleQuote
public java.lang.String nextQuotesExcludeDoubleQuote()
skipQuotes
public void skipQuotes()
skipBrackets
public void skipBrackets()
nextWord
public java.lang.String nextWord()
skipWord
public void skipWord()
nextSentence
public java.lang.String nextSentence()
nextWhitespace
public java.lang.String nextWhitespace()
skipWhitespace
public boolean skipWhitespace()
backupWhitespace
public void backupWhitespace()
nextLine
public java.lang.String nextLine()
currentLine
public java.lang.String currentLine()
currentLineNumber
public int currentLineNumber()
currentLineColumn
public int currentLineColumn()
skipLine
public void skipLine()
getPosition
public int getPosition()
setPosition
public void setPosition(int index)
getText
public java.lang.String getText()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object