public class DocumentCharacterIterator
extends java.lang.Object
implements java.text.CharacterIterator, java.lang.CharSequence
org.eclipse.jdt.internal.ui.text.DocumentCharacterIterator
.Constructor and Description |
---|
DocumentCharacterIterator(org.eclipse.jface.text.IDocument document)
Creates an iterator for the entire document.
|
DocumentCharacterIterator(org.eclipse.jface.text.IDocument document,
int first)
Creates an iterator, starting at offset
first . |
DocumentCharacterIterator(org.eclipse.jface.text.IDocument document,
int first,
int last)
Creates an iterator for the document contents from
first (inclusive) to last
(exclusive). |
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index)
Note that, if the document is modified concurrently, this method may return
CharacterIterator.DONE if a
BadLocationException was thrown when accessing the backing document. |
java.lang.Object |
clone() |
char |
current() |
char |
first() |
int |
getBeginIndex() |
int |
getEndIndex() |
int |
getIndex() |
char |
last() |
int |
length() |
char |
next() |
char |
previous() |
char |
setIndex(int position) |
java.lang.CharSequence |
subSequence(int start,
int end) |
public DocumentCharacterIterator(org.eclipse.jface.text.IDocument document) throws org.eclipse.jface.text.BadLocationException
document
- the document backing this iteratororg.eclipse.jface.text.BadLocationException
- if the indices are out of boundspublic DocumentCharacterIterator(org.eclipse.jface.text.IDocument document, int first) throws org.eclipse.jface.text.BadLocationException
first
.document
- the document backing this iteratorfirst
- the first character to considerorg.eclipse.jface.text.BadLocationException
- if the indices are out of boundspublic DocumentCharacterIterator(org.eclipse.jface.text.IDocument document, int first, int last) throws org.eclipse.jface.text.BadLocationException
first
(inclusive) to last
(exclusive).document
- the document backing this iteratorfirst
- the first character to considerlast
- the last character index to considerorg.eclipse.jface.text.BadLocationException
- if the indices are out of boundspublic char first()
first
in interface java.text.CharacterIterator
public char last()
last
in interface java.text.CharacterIterator
public char current()
current
in interface java.text.CharacterIterator
public char next()
next
in interface java.text.CharacterIterator
public char previous()
previous
in interface java.text.CharacterIterator
public char setIndex(int position)
setIndex
in interface java.text.CharacterIterator
public int getBeginIndex()
getBeginIndex
in interface java.text.CharacterIterator
public int getEndIndex()
getEndIndex
in interface java.text.CharacterIterator
public int getIndex()
getIndex
in interface java.text.CharacterIterator
public java.lang.Object clone()
clone
in interface java.text.CharacterIterator
clone
in class java.lang.Object
public int length()
length
in interface java.lang.CharSequence
public char charAt(int index)
Note that, if the document is modified concurrently, this method may return CharacterIterator.DONE
if a
BadLocationException
was thrown when accessing the backing document.
charAt
in interface java.lang.CharSequence
index
- public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence