edu.iastate.jtm.util
Class SlidingWindow
java.lang.Object
edu.iastate.jtm.util.SlidingWindow
public class SlidingWindow
- extends java.lang.Object
- Author:
- dingjing
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SPACE
public static final int SPACE
- See Also:
- Constant Field Values
DASH
public static final int DASH
- See Also:
- Constant Field Values
PUNC
public static final int PUNC
- See Also:
- Constant Field Values
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
LETTER
public static final int LETTER
- See Also:
- Constant Field Values
DIGIT
public static final int DIGIT
- See Also:
- Constant Field Values
SlidingWindow
public SlidingWindow(boolean split)
- Creates a new instance of SlidingWindow
SlidingWindow
public SlidingWindow()
setSplitDigit
public void setSplitDigit(boolean sp)
setCharType
public void setCharType(CharType ct)
atStart
public boolean atStart()
atStart
public boolean atStart(int id)
reachEnd
public boolean reachEnd()
reachEnd
public boolean reachEnd(int id)
start
public int start()
start
public void start(int s)
end
public int end()
end
public void end(int e)
mark
public void mark()
markValid
public boolean markValid()
unmark
public void unmark()
resetWindow
public int resetWindow(java.nio.CharBuffer dst)
resetWindow
public int resetWindow(java.lang.CharSequence sen,
java.nio.CharBuffer dst)
resetSize
public void resetSize()
resetSizeToMark
public void resetSizeToMark()
expandWindow
public int expandWindow(java.nio.CharBuffer dst,
boolean skipParen,
boolean skipSpace)
- Increase window size by 1 stride. If skipParen is true, and the
immediately followed stride is a skippable, increase the window
size to the end of the skippable. Copy new content to a buffer
(not include skipped content).
- Parameters:
dst - destination buffer for new contentskipParen - whether or not skip parenthesis if followedskipSpace - whether or not copy space to the destination buffer
- Returns:
- number of characters copied
slideWindow
public int slideWindow(java.nio.CharBuffer dst,
boolean skipParen,
boolean skipSpace)
walkWindow
public int walkWindow(java.nio.CharBuffer dst,
boolean skipParen,
boolean skipSpace)
skip
public int skip(java.nio.CharBuffer content)
getSkipTo
public int getSkipTo(int i)
copyWindow
public int copyWindow(java.nio.CharBuffer dst)
getWindowText
public java.lang.String getWindowText()
getAllText
public java.lang.String getAllText()
length
public int length()
getWindowStartPosition
public int getWindowStartPosition()
getWindowEndPosition
public int getWindowEndPosition()
copyToMark
public int copyToMark(java.nio.CharBuffer dst)
copyFromMark
public int copyFromMark(java.nio.CharBuffer dst)
copyFromTo
public int copyFromTo(java.nio.CharBuffer dst,
int from,
int to)
nextSkippable
public boolean nextSkippable()
printStrides
public void printStrides()
main
public static void main(java.lang.String[] args)