|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.fw.util.EboEditBuffer
This is a utility class that is a variant of a string buffer optimized for text replacement operations
Constructor Summary | |
EboEditBuffer()
Constructor of EboEditBuffer |
|
EboEditBuffer(int len)
Constructor of EditBuffer with an input parameter |
|
EboEditBuffer(String str)
Constructor of EboEditBuffer with an input parameter |
Method Summary | |
EboEditBuffer |
append(boolean b)
Appends a specified boolean to the end of the edit buffer. |
EboEditBuffer |
append(char c)
Appends a specified character to the end of the edit buffer. |
EboEditBuffer |
append(double d)
Appends a specified double to the end of the edit buffer. |
EboEditBuffer |
append(float f)
Appends a specified float to the end of the edit buffer. |
EboEditBuffer |
append(int i)
Appends a specified int to the end of the edit buffer. |
EboEditBuffer |
append(long l)
Appends a specified long to the end of the edit buffer. |
EboEditBuffer |
append(String str)
Appends a specified string to the end of the edit buffer. |
char |
charAt(int index)
Gets a character at the specified index from the text. |
EboEditBuffer |
delete(int offset,
int count)
Deletes the bytes from the buffer based on a specified index and lengh. |
void |
ensureCapacity(int minsize)
Ensures that the edit buffer has enough space to provide text editing. |
void |
escape(String escapeCharacters)
Escapes all characters in the list of escape characters with a backslash |
int |
fixLineTerminators(int startpos,
int count)
Scans a sequence of characters in the buffer and ensures that all line terminators are LF (\n). |
char[] |
getBuffer()
Gets the actual text from this edit buffer instance. |
CharacterIterator |
getCharacterIterator(boolean codeeditor)
Creates a Character Iterator for this edit buffer. |
void |
getChars(char[] tobuf,
int tooffset,
int fromoffset,
int count)
Copies specified number of chareacters from a specified index in the edit buffer to a specified index in the specified output character buffer. |
char[] |
getChars(int fromoffset,
int count)
Gets the specified number of characters from the edit buffer starting from a specified index. |
int |
indexOf(int ch,
int fromIndex)
Returns the index within this string of the first occurrence of the specified character, starting the search at fromIndex. |
int |
indexOf(String s,
int fromIndex)
Returns the index within this string of the first occurrence of the specified String, starting the search at fromIndex. |
int |
indexOf(String s,
int fromIndex,
boolean casesensitive)
Returns the index within this string of the first occurrence of the specified String, starting the search at fromIndex. |
EboEditBuffer |
insert(int offset,
boolean b)
Inserts a boolean value into the edit buffer starting from a specified index. |
EboEditBuffer |
insert(int inspos,
char c)
Inserts a character to the edit buffer starting from a specified index. |
EboEditBuffer |
insert(int offset,
double d)
Inserts a specified double to the edit buffer starting from a specified index. |
EboEditBuffer |
insert(int offset,
float f)
Inserts a float to the edit buffer starting from a specified index. |
EboEditBuffer |
insert(int offset,
int i)
Inserts an int to the edit buffer starting from a specified index. |
EboEditBuffer |
insert(int offset,
long l)
Inserts a long to the edit buffer starting from a specified index. |
EboEditBuffer |
insert(int offset,
String str)
Inserts a specified string to the edit buffer starting from a specified index. |
int |
insertFromReader(Reader r,
int inspos)
Inserts the entire contents of the reader into the buffer. |
int |
lastIndexOf(String s,
int fromIndex)
Returns the index within this string of the last occurrence of the specified String, searching backward from fromIndex. |
int |
lastIndexOf(String s,
int fromIndex,
boolean casesensitive)
Returns the index within this string of the last occurrence of the specified String, searching backward from fromIndex. |
int |
length()
Gets the actual text size. |
EboEditBuffer |
munge(int inspos,
int delcount,
char[] bytes,
int firstbytetoinsert,
int inscount)
Cuts and Pastes the edit buffer starting from specified index. |
EboEditBuffer |
munge(int offset,
int delCount,
EboEditBuffer srcbuffer,
int firstbytetoinsert,
int insCount)
Cuts and Pastes the edit buffer starting from specified index. |
EboEditBuffer |
munge(int inspos,
int delcount,
String str)
Cuts and Pastes the edit buffer starting from specified index. |
void |
replace(int start,
int end,
String replace)
Replaces a substring specified by its start and end character locations with another string. |
void |
replace(String find,
String replace)
Replaces all occurrences of one string with another. |
void |
replace(String find,
String replace,
String wordChars)
Replaces all occurrences of one a whole word string with another. |
void |
replaceIgnoreCase(String find,
String replace)
Replaces all occurrences of one string with another ignoring case when matching the 'find' string. |
EboEditBuffer |
reset(String str)
Resets the edit buffer with provided text string. |
EboEditBuffer |
reverse()
Reverses the characters in this buffer |
void |
setCharAt(int index,
char c)
Modifies the edit buffer by storing the input character at specified index. |
void |
setLength(int length)
Sets the length of the text in edit buffer. |
String |
substring(int fromoffset)
Gets a substring from the edit buffer starting from a specified index. |
String |
substring(int fromoffset,
int endoffset)
Gets a substring from the edit buffer starting and ending from specified indics. |
String |
toString()
Gets the text String from the edit buffer. |
String |
toString(int start,
int count)
Gets the SubString from the edit buffer based on a starting index and a length. |
void |
translateBuffer(String[] args)
Performs string substitution based on an array of supplied substitution strings. |
void |
translateBufferEx(Object[] args)
This version of translate buffer translates Object arguments and has no limit on the number of substitutions. |
void |
unescape(String escapeCharacters)
Undoes the effect of the 'escape' method |
void |
uniEscape(String escapeCharacters)
No information available |
void |
uniEscape(String escapeCharacters,
boolean toASCII)
No information available |
void |
uniUnescape()
The opposite of uniEscape - turns É into É, \\ into \, etc. |
void |
writeChars(Writer writer)
Writes the characters from the edit buffer to a Writer object. |
void |
writeChars(Writer writer,
int pos,
int count)
Writes the characters from the edit buffer to a Writer object. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public EboEditBuffer()
public EboEditBuffer(String str)
str
- a String to be used by this edit bufferpublic EboEditBuffer(int len)
len
- a increment size that is used to expand the
edit buffer when the buffer is full.Method Detail |
public int length()
public String toString()
public String toString(int start, int count)
start
- a position to startcount
- the size from starting position.public CharacterIterator getCharacterIterator(boolean codeeditor)
codeeditor
- if set to true it considers the text as Java code,
treats the special characters '-' and '.' as word break characters.public char charAt(int index)
index
- public void setCharAt(int index, char c)
index
- a specified indexc
- a character need to be stored at the specified locationpublic void getChars(char[] tobuf, int tooffset, int fromoffset, int count)
tobuf
- an output character buffer.tooffset
- a start index of the output character buffer where
the characters are copied to.fromoffset
- a start index of the edit buffer where the characters
start to be copied.count
- a number of characters to be copied.public char[] getChars(int fromoffset, int count)
fromoffset
- a start index of the edit buffer that the characters
start to be copied.count
- a number of charactered to be copied.public String substring(int fromoffset)
fromoffset
- a start index of the edit buffer where the substring
starts to be copied.public String substring(int fromoffset, int endoffset)
fromoffset
- a start index of the edit buffer where the substring starts to
be copied.endoffset
- an end index of the edit buffer where the substring ends.public EboEditBuffer reset(String str)
str
- a text String to be replaced in the edit buffer.EboEditBuffer
object with the
replaced text String.public void setLength(int length)
length
- a specified lengthpublic EboEditBuffer insert(int offset, String str)
offset
- a start index of the edit buffer where the input string
is copied to.str
- a specified string to be inserted into the edit buffer.EboEditBuffer
object with string inserted.public EboEditBuffer insert(int offset, boolean b)
offset
- a start index to insert the boolean valueb
- a boolean value to be inserted.EboEditBuffer
object with inserted character.public EboEditBuffer insert(int inspos, char c)
inspos
- an insert indexc
- a specified characterEboEditBuffer
object after inserting the
character.public EboEditBuffer insert(int offset, int i)
offset
- a start indexi
- a specified intEboEditBuffer
object after inserting the
int.public EboEditBuffer insert(int offset, long l)
offset
- a start indexl
- a specified longEboEditBuffer
object after inserting
the long.public EboEditBuffer insert(int offset, float f)
offset
- a start indexf
- a specified floatEboEditBuffer
object after inserting
the float.public EboEditBuffer insert(int offset, double d)
offset
- a start indexd
- a specified doubleEboEditBuffer
object with inserted doublepublic EboEditBuffer append(String str)
str
- a specified string to be appended into the edit buffer.EboEditBuffer
object with the string appended.public EboEditBuffer append(boolean b)
b
- a specified boolean to be appended into the edit buffer.EboEditBuffer
object with the boolean appended.public EboEditBuffer append(char c)
c
- a specified character to be appended into the edit buffer.EboEditBuffer
object with the character appended.public EboEditBuffer append(int i)
i
- a specified int to be appended into the edit buffer.EboEditBuffer
object with the int appended.public EboEditBuffer append(long l)
l
- a specified long to be appended into the edit buffer.EboEditBuffer
object with the long appended.public EboEditBuffer append(float f)
f
- a specified float to be appended into the edit buffer.EboEditBuffer
object with the float appended.public EboEditBuffer append(double d)
d
- a specified double to be appended into the edit buffer.EboEditBuffer
object with the double appended.public EboEditBuffer delete(int offset, int count)
offset
- an index where to start the delete operation.count
- a anumber of bytes to be deleted.EboEditBuffer
object after completing
the delete operation.public void writeChars(Writer writer) throws IOException
Writer
object.writer
- a Writer
object.public void writeChars(Writer writer, int pos, int count) throws IOException
Writer
object.writer
- a Writer
object.pos
- a start index of the edit buffer where to start copying the text.count
- a number of bytes to be copied to the writer.public int insertFromReader(Reader r, int inspos) throws IOException
r
- a Reader
object.inspos
- a specified insert index where to start copy the contents.public int fixLineTerminators(int startpos, int count)
public EboEditBuffer munge(int inspos, int delcount, String str)
inspos
- an insert index to starting this cut and paste operation.delcount
- number of characters to be removed from edit buffer starting
from the specified insert index.str
- a string to be replaced starting from the specified insert index.
if str is null, only cut operation is performed.EboEditBuffer
object after completing the cut
and paste operation.public EboEditBuffer munge(int inspos, int delcount, char[] bytes, int firstbytetoinsert, int inscount)
inspos
- an insert index to starting this cut and paste operation.delcount
- number of characters to be removed from edit buffer starting
from the specified insert index.bytes
- a character array to be replaced starting from the specified
insert index.firstbytetoinsert
- a specified offset in the byte array for the bytes
to be copied.inscount
- a number of bytes to be copied from the byte array to
the edit buffer.EboEditBuffer
object after completing the cut
and paste operation.public EboEditBuffer munge(int offset, int delCount, EboEditBuffer srcbuffer, int firstbytetoinsert, int insCount)
inspos
- an insert index to starting this cut and paste operation.delcount
- number of characters to be removed from edit buffer starting
from the specified insert index.srcbuffer
- an edit buffer where the text will be copied into this edit buffer.firstbytetoinsert
- a specified offset in the edit buffer for the characters
to be copied.inscount
- a number of bytes to be copied from the provided edit buffer
to this edit buffer instance.EboEditBuffer
object after completing the cut
and paste operation.public char[] getBuffer()
public void ensureCapacity(int minsize)
minsize
- a minimum size that the edit buffer should have. If not,
it will expand the buffer to meet this criteria.public int indexOf(int ch, int fromIndex)
ch
- the character to search forfromIndex
- the index to start the search frompublic int indexOf(String s, int fromIndex)
s
- the string to search forfromIndex
- the index to start the search frompublic int indexOf(String s, int fromIndex, boolean casesensitive)
s
- the string to search forfromIndex
- the index to start the search fromcasesensitive
- if false, performs a case-insensitive match of the search stringpublic int lastIndexOf(String s, int fromIndex)
s
- the string to search forfromIndex
- the index to start the search frompublic int lastIndexOf(String s, int fromIndex, boolean casesensitive)
s
- the string to search forfromIndex
- the index to start the search fromcasesensitive
- if false, performs a case-insensitive match of the search stringpublic void replace(int start, int end, String replace)
start
- the start character location (inclusive)end
- the end character location (exclusive, same as substring): may be -1 to indicate insertreplace
- the string to replace it with: may be null to indicate deletepublic void replace(String find, String replace)
find
- the string to findreplace
- the string to replace it withpublic void replaceIgnoreCase(String find, String replace)
find
- the string to findreplace
- the string to replace it withpublic void replace(String find, String replace, String wordChars)
find
- the string to findreplace
- the string to replace it withwordChars
- the characters outside of the alphabetic characters
that can also be part of the word.public EboEditBuffer reverse()
public void escape(String escapeCharacters)
public void unescape(String escapeCharacters)
public void uniEscape(String escapeCharacters)
public void uniEscape(String escapeCharacters, boolean toASCII)
public void uniUnescape()
public void translateBuffer(String[] args)
public void translateBufferEx(Object[] args)
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |