|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.data.SingleLineTxt
This class is an impl ementation of TextModel
interface. It is used to
represent single line text, it means that in any case the specified input string is
parsed to single line (you can use '\n' delimiter, but it will not have effect)
text with the implementation.
Constructor Summary | |
SingleLineTxt(java.lang.String s)
Constructs a new text with the given text. |
|
SingleLineTxt(java.lang.String s,
int max)
Constructs a new text with the given text and the specified maximal length. |
Method Summary | |
void |
addTextListener(TextListener l)
Adds the specified text listener. |
int |
getExtraChar(int i)
Gets special extra char that is used to store extra information by the specified index. |
java.lang.String |
getLine(int line)
Returns the line at the specified line number. |
int |
getSize()
Returns the line number of the text. |
java.lang.String |
getText()
Returns the original text data that have been set with setText method. |
int |
getTextLength()
Returns the text length. |
void |
remove(int offset,
int size)
Removes a text at the specified offset with the size. |
void |
removeTextListener(TextListener l)
Removes the specified text listener. |
void |
setExtraChar(int i,
int ch)
Sets special extra char that is used to store extra information by the specified index. |
void |
setText(java.lang.String text)
Sets the specified text data. |
void |
write(char ch,
int offset)
Inserts the specified character at the given offset. |
void |
write(java.lang.String s,
int offset)
Inserts the specified text at the given offset. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SingleLineTxt(java.lang.String s)
s
- the initial value of the text.public SingleLineTxt(java.lang.String s, int max)
s
- the initial value of the text.max
- the specified maximal length.Method Detail |
public java.lang.String getLine(int line)
getLine
in interface TextModel
line
- the specified line number. The implementation doesn't use
the argument, since this is single line implementation.public void setText(java.lang.String text)
setText
in interface TextModel
text
- the text data.public java.lang.String getText()
setText
method.getText
in interface TextModel
public int getSize()
getSize
in interface TextModel
public void write(java.lang.String s, int offset)
write
in interface TextModel
s
- the text to be inserted.offset
- the offset where the text will be inserted.public void write(char ch, int offset)
write
in interface TextModel
ch
- the character to be inserted.offset
- the offset where the character will be inserted.public void remove(int offset, int size)
remove
in interface TextModel
offset
- the offset where the text will be removed.size
- the size of the part that is going to be removed.public void addTextListener(TextListener l)
addTextListener
in interface TextModel
l
- the text listener.public void removeTextListener(TextListener l)
removeTextListener
in interface TextModel
l
- the text listener.TextListener
,
TextEvent
public int getTextLength()
getTextLength
in interface TextModel
public int getExtraChar(int i)
TextModel
getExtraChar
in interface TextModel
org.zaval.data.TextModel
i
- the specified extra char index.public void setExtraChar(int i, int ch)
TextModel
setExtraChar
in interface TextModel
org.zaval.data.TextModel
i
- the specified extra char index.val
- the specified extra char value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |