Package net.sf.xslthl
Class CharIter
java.lang.Object
net.sf.xslthl.CharIter
A special character iterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMatcher
(Pattern pattern) Create a pattern matchercurrent()
boolean
finished()
int
int
getMark()
int
boolean
hasNext()
int
boolean
isMarked()
iterator()
markedToStyledBlock
(String styleName) Create a style block, unless the stylename is equale to "none"void
moveNext()
Increase the pointervoid
moveNext
(int offset) Increase the point with the given offsetvoid
Increase the pointer and mark the position after itvoid
Move to the end of the stringnext()
next
(int offset) prev()
prev
(int offset) int
void
remove()
void
setMark()
Set the current position as the markvoid
setMark
(int newMark) Set the mark to the given locationboolean
startsWith
(String prefix) boolean
startsWith
(String prefix, boolean ignoreCase) boolean
startsWith
(String prefix, int diff) boolean
startsWith
(String prefix, int diff, boolean ignoreCase) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
CharIter
-
-
Method Details
-
getMark
public int getMark()- Returns:
- the marked position
-
setMark
public void setMark()Set the current position as the mark -
setMark
public void setMark(int newMark) Set the mark to the given location- Parameters:
newMark
-
-
isMarked
public boolean isMarked()- Returns:
- true if there is a mark set
-
getMarked
- Returns:
- the marked section
-
markedToBlock
- Returns:
- the marked string as a block
-
markedToStyledBlock
Create a style block, unless the stylename is equale to "none"- Parameters:
styleName
-- Returns:
- the marked string as a styled block
-
moveNext
public void moveNext()Increase the pointer -
moveNext
public void moveNext(int offset) Increase the point with the given offset- Parameters:
offset
-
-
moveNextAndMark
public void moveNextAndMark()Increase the pointer and mark the position after it -
moveToEnd
public void moveToEnd()Move to the end of the string -
finished
public boolean finished()- Returns:
- true if the iterator finished
-
current
- Returns:
- the current character
-
next
-
next
- Parameters:
offset
-- Returns:
- the characters at the given offset
-
prev
- Returns:
- the previous character
-
prev
- Parameters:
offset
-- Returns:
- the previous character at a given offset
-
startsWith
- Parameters:
prefix
-- Returns:
- true if the current position starts with the prefix
-
startsWith
- Parameters:
prefix
-ignoreCase
-- Returns:
- true if the current position starts with the prefix
-
startsWith
- Parameters:
prefix
-diff
-- Returns:
- true if the current position starts with the prefix at a given offset
-
startsWith
- Parameters:
prefix
-diff
-ignoreCase
-- Returns:
- true if the current position starts with the prefix at a given offset
-
createMatcher
Create a pattern matcher- Parameters:
pattern
-
-
getPosition
public int getPosition()- Returns:
-
getLength
public int getLength()- Returns:
-
remaining
public int remaining()- Returns:
- the remaining characters in the buffer
-
indexOf
- Parameters:
substr
-- Returns:
- the index of the given string
-
iterator
-
hasNext
public boolean hasNext() -
remove
public void remove()
-