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 Documentprivate intPosition of iterator in document.private intIndex of end of current segment in document.private final SegmentFields inherited from interface 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:
clonein interfaceCharacterIterator- Overrides:
clonein classObject
-
current
public char current()- Specified by:
currentin interfaceCharacterIterator
-
first
public char first()- Specified by:
firstin interfaceCharacterIterator
-
getBeginIndex
public int getBeginIndex()- Specified by:
getBeginIndexin interfaceCharacterIterator
-
getEndIndex
public int getEndIndex()- Specified by:
getEndIndexin interfaceCharacterIterator
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceCharacterIterator
-
last
public char last()- Specified by:
lastin interfaceCharacterIterator
-
next
public char next()Increments the iterator's index by one and returns the character at the new index.- Specified by:
nextin interfaceCharacterIterator- Returns:
- the character at the new position, or DONE if the new position is off the end
-
previous
public char previous()- Specified by:
previousin interfaceCharacterIterator
-
setIndex
public char setIndex(int position) - Specified by:
setIndexin interfaceCharacterIterator
-