Package edu.umd.cs.findbugs.sourceViewer
Class DocumentCharacterIterator
java.lang.Object
edu.umd.cs.findbugs.sourceViewer.DocumentCharacterIterator
- All Implemented Interfaces:
Cloneable
,CharacterIterator
A CharacterIterator over a Document. Only a partial implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Document
private int
Position of iterator in document.private int
Index of end of current segment in document.private final Segment
Fields inherited from interface java.text.CharacterIterator
DONE
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
doc
-
text
-
docPos
private int docPosPosition of iterator in document. -
segmentEnd
private int segmentEndIndex of end of current segment in document.
-
-
Constructor Details
-
DocumentCharacterIterator
DocumentCharacterIterator(Document doc)
-
-
Method Details
-
clone
- Specified by:
clone
in interfaceCharacterIterator
- Overrides:
clone
in classObject
-
current
public char current()- Specified by:
current
in interfaceCharacterIterator
-
first
public char first()- Specified by:
first
in interfaceCharacterIterator
-
getBeginIndex
public int getBeginIndex()- Specified by:
getBeginIndex
in interfaceCharacterIterator
-
getEndIndex
public int getEndIndex()- Specified by:
getEndIndex
in interfaceCharacterIterator
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceCharacterIterator
-
last
public char last()- Specified by:
last
in interfaceCharacterIterator
-
next
public char next()Increments the iterator's index by one and returns the character at the new index.- Specified by:
next
in interfaceCharacterIterator
- Returns:
- the character at the new position, or DONE if the new position is off the end
-
previous
public char previous()- Specified by:
previous
in interfaceCharacterIterator
-
setIndex
public char setIndex(int position) - Specified by:
setIndex
in interfaceCharacterIterator
-