|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.text.DocumentCharacterIterator
public class DocumentCharacterIterator
An IDocument
based implementation of
CharacterIterator
and CharSequence
. Note that
the supplied document is not copied; if the document is modified during the
lifetime of a DocumentCharacterIterator
, the methods
returning document content may not always return the same values. Also, if
accessing the document fails with a BadLocationException
, any of
CharacterIterator
methods as well as charAt
may
return CharacterIterator.DONE
.
Field Summary |
---|
Fields inherited from interface java.text.CharacterIterator |
---|
DONE |
Constructor Summary | |
---|---|
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). |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.CharSequence |
---|
toString |
Constructor Detail |
---|
public DocumentCharacterIterator(org.eclipse.jface.text.IDocument document)
document
- the document backing this iteratorpublic DocumentCharacterIterator(org.eclipse.jface.text.IDocument document, int first) throws java.lang.IllegalArgumentException
first
.
document
- the document backing this iteratorfirst
- the first character to consider
java.lang.IllegalArgumentException
- if the indices are out of boundspublic DocumentCharacterIterator(org.eclipse.jface.text.IDocument document, int first, int last) throws java.lang.IllegalArgumentException
first
(inclusive) to last
(exclusive).
document
- the document backing this iteratorfirst
- the first character to considerlast
- the last character index to consider
java.lang.IllegalArgumentException
- if the indices are out of boundsMethod Detail |
---|
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |