|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.text.StringTextBuffer
public class StringTextBuffer
An implementatin of the ITextBuffer interface using the String object to store the contents of the text buffer.
| Constructor Summary | |
|---|---|
StringTextBuffer()
Initialize an empty text buffer. |
|
StringTextBuffer(java.lang.String s)
Initialize the text buffer with the supplied String. |
|
| Method Summary | |
|---|---|
void |
addTextBufferListener(ITextBufferListener l)
Adds an ITextBufferListener to this object to receive notifications of changes which take place when the text buffer is changed. |
void |
append(java.lang.String str)
Appends the specified string to the end of this object and calls the textChanged method of its listeners with the range
of the appended text. |
void |
delete(int fromIndex,
int toIndex)
Removes the specified range of text from this object and calls the textChanged method of its listeners with the location
of the removed text. |
TextRange |
findText(int fromIndex,
ITextFinder textFinder)
Returns the next text range in the text buffer found by the specified text finder starting at the specified index. |
int |
getLength()
Returns the size of the text buffer managed by this object. |
java.lang.String |
getText()
Returns a string representing the contents of the text buffer. |
java.lang.String |
getText(int fromIndex,
int toIndex)
Returns a string representing the contents of the text buffer contained within the specified range. |
int |
indexOf(char ch,
int fromIndex)
Returns the index of the first occurence of the specified character starting at the specified location and continuing to the end of the buffer. |
void |
insertText(java.lang.String str,
int position)
Inserts a string into the text buffer at the specified location and calls the textChanged method of its listeners with the location
of the inserted text. |
int |
prevIndexOf(char ch,
int fromIndex)
Returns the index of the previous occurence of the specified character starting at the specified location and continuing to the end of the buffer. |
void |
removeTextBufferListener(ITextBufferListener l)
Removes an ITextBufferListener from this object. |
void |
setText(java.lang.String str)
Sets the value of this text buffer to the specified String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringTextBuffer()
public StringTextBuffer(java.lang.String s)
a - reference to a String.| Method Detail |
|---|
public void addTextBufferListener(ITextBufferListener l)
addTextBufferListener in interface ITextBufferl - a reference to an object which implements ITextBufferListener.public void append(java.lang.String str)
textChanged method of its listeners with the range
of the appended text.
append in interface ITextBufferstr - a reference to a String.
public void delete(int fromIndex,
int toIndex)
textChanged method of its listeners with the location
of the removed text. The fromIndex and toIndex
parameters may be specified in any order.
delete in interface ITextBufferfromIndex - the starting index from where text will be removed.toIndex - the ending index to where text will be removed.
public TextRange findText(int fromIndex,
ITextFinder textFinder)
findText in interface ITextBufferfromIndex - the starting index from where search will begin.textFinder - a reference to an object implementing ITextFinder.
public int getLength()
getLength in interface ITextBufferpublic java.lang.String getText()
getText in interface ITextBuffer
public java.lang.String getText(int fromIndex,
int toIndex)
fromIndex
and toIndex parameters may be specified in any order.
getText in interface ITextBufferfromIndex - the starting index from where text will be taken.toIndex - the ending index to where text will be taken.
public int indexOf(char ch,
int fromIndex)
indexOf in interface ITextBufferch - the character to match.fromIndex - the starting index from where the search will begin.
public void insertText(java.lang.String str,
int position)
textChanged method of its listeners with the location
of the inserted text.
insertText in interface ITextBufferstr - a reference to a String.atIndex - the index of the location where the text should be inserted.
public int prevIndexOf(char ch,
int fromIndex)
prevIndexOf in interface ITextBufferch - the character to match.fromIndex - the starting index from where the search will begin.
public void removeTextBufferListener(ITextBufferListener l)
removeTextBufferListener in interface ITextBufferl - a reference to an object which implements ITextBufferListener.public void setText(java.lang.String str)
setText in interface ITextBufferstr - a reference to a String.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||