Class Text
- java.lang.Object
-
- javolution37.javolution.realtime.RealtimeObject
-
- javolution37.javolution.lang.Text
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.CharSequence, java.lang.Comparable, Immutable, Realtime
public abstract class Text extends RealtimeObject implements java.lang.CharSequence, java.lang.Comparable, java.io.Serializable, Immutable
This class represents an immutable character sequence with extremely fast
concatenation,insertionanddeletioncapabilities (O[Log(n)]) instead of O[n] for StringBuffer/StringBuilder).Instances of this class have the following advantages over
String:- No need for an intermediate
StringBufferin order to manipulate textual documents.Textmethods are much faster (especially for large documents). - Bug free. They are not plagued by the
String.substring(int)memory leak bug (when small substrings prevent memory from larger string from being garbage collected). - More flexible as they allows for search and comparison with any
java.lang.StringorCharSequence. - Easy
formattingusing theTextBuilderclass (no need to specify the buffer capacity as it gently increases without incurring expensive resize/copy operations). - Real-time compliant (instances allocated on the "stack" when
executing in a
PoolContext).
As for any
CharSequence, parsing of primitive types can be achieved using theTypeFormatutility class.Textliterals should be explicitelyinterned. Unlike strings literals and strings-value constant expressions, interning is not implicit. For example:Interned texts are always allocated in ImmortalMemory (RTSJ VMs).final static Text TRUE = Text.intern("true"); final static Text FALSE = Text.intern("false");Implementation Note: To avoid expensive copy operations ,
Textinstances are broken down into smaller immutable sequences (they form a minimal-depth binary tree). Internal copies are then performed inO[Log(n)]instead ofO[n]).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javolution37.javolution.realtime.RealtimeObject
RealtimeObject.Factory<T extends RealtimeObject>
-
Nested classes/interfaces inherited from interface javolution37.javolution.realtime.Realtime
Realtime.ObjectSpace
-
-
Field Summary
Fields Modifier and Type Field and Description static TextEMPTYHolds an empty character sequence.static TextNULLHolds the"null"character sequence.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract charcharAt(int index)Returns the character at the specified index.intcompareTo(java.lang.Object csq)Compares this text to another character sequence or string lexicographically.Textconcat(Text that)Concatenates the specified text to the end of this text.booleancontentEquals(java.lang.CharSequence csq)Indicates if this text has the same character content as the specified character sequence.booleancontentEqualsIgnoreCase(java.lang.CharSequence csq)Indicates if this text has the same character contend as the specified character sequence ignoring case considerations.Textcopy()Returns a compact copy of this text allocated on the stack when executing in aPoolContext.Textdelete(int start, int end)Returns the text without the characters between the specified indexes.abstract intdepth()Returns the depth of the internal tree used to represent this text.booleanendsWith(java.lang.CharSequence suffix)Indicates if this text ends with the specified suffix.booleanequals(java.lang.Object obj)Compares this text against the specified object for equality.abstract voidgetChars(int start, int end, char[] dest, int destPos)Copies the characters from this text into the destination character array.inthashCode()Returns the hash code for this text.abstract intindexOf(char c, int fromIndex)Returns the index within this text of the first occurrence of the specified character, starting the search at the specified index.intindexOf(java.lang.CharSequence csq)Returns the index within this text of the first occurrence of the specified character sequence searching forward.intindexOf(java.lang.CharSequence csq, int fromIndex)Returns the index within this text of the first occurrence of the specified characters sequence searching forward from the specified index.intindexOfAny(CharSet charSet)Returns the index within this text of the first occurrence of any character in the specified character set.intindexOfAny(CharSet charSet, int start)Returns the index within a region of this text of the first occurrence of any character in the specified character set.intindexOfAny(CharSet charSet, int start, int length)Returns the index within a region of this text of the first occurrence of any character in the specified character set.Textinsert(int index, Text txt)Returns the text having the specified text inserted at the specified location.static Textintern(java.lang.CharSequence csq)Returns a text equals to the specified character sequence from a pool of unique text instances inImmortalMemory.static Textintern(java.lang.String str)Returns a text equals to the specified string from a pool of unique text instances inImmortalMemory.booleanisBlank()Indicates if all characters of this text are whitespaces (no characters greater than the space character).booleanisBlank(int start, int length)Indicates if the specified sub-range of characters of this text are whitespaces (no characters greater than the space character).abstract intlastIndexOf(char c, int fromIndex)Returns the index within this text of the first occurrence of the specified character, searching backward and starting at the specified index.intlastIndexOf(java.lang.CharSequence csq)Returns the index within this text of the last occurrence of the specified characters sequence searching backward.intlastIndexOf(java.lang.CharSequence csq, int fromIndex)Returns the index within this text of the last occurrence of the specified character sequence searching backward from the specified index.intlastIndexOfAny(CharSet charSet)Returns the index within this text of the last occurrence of any character in the specified character set.intlastIndexOfAny(CharSet charSet, int start)Returns the index within a region of this text of the last occurrence of any character in the specified character set.intlastIndexOfAny(CharSet charSet, int start, int length)Returns the index within a region of this text of the last occurrence of any character in the specified character set.intlength()Returns the length of this text.TextpadLeft(int len)Pads this text on the left with spaces to make the minimum total length as specified.TextpadLeft(int len, char c)Pads this text on the left to make the minimum total length as specified.TextpadRight(int len)Pads this text on the right with spaces to make the minimum total length as specified.TextpadRight(int len, char c)Pads this text on the right to make the minimum total length as specified.Textplus(java.lang.Object obj)Returns the concatenation of this text and the textual representation of the specified object.Textreplace(Text target, Text replacement)Replaces each character sequence of this text that matches the specified target sequence with the specified replacement sequence.booleanstartsWith(java.lang.CharSequence prefix)Indicates if this text starts with the specified prefix.booleanstartsWith(java.lang.CharSequence prefix, int index)Indicates if this text starts with the specified prefix at the specified index.abstract java.lang.StringstringValue()Returns theStringvalue corresponding to this text.java.lang.CharSequencesubSequence(int start, int end)Returnssubtext(start, end).Textsubtext(int start)Returns a portion of this text.abstract Textsubtext(int start, int end)Returns a portion of this text.abstract TexttoLowerCase()Converts the characters of this text to lower case.TexttoText()Returnsthis(implementsRealtimeinterface).abstract TexttoUpperCase()Converts the characters of this text to upper case.Texttrim()Returns a copy of this text, with leading and trailing whitespace omitted.TexttrimEnd()Returns a copy of this text, with trailing whitespace omitted.TexttrimStart()Returns a copy of this text, with leading whitespace omitted.static TextvalueOf(boolean b)Returns the text representation of thebooleanargument.static TextvalueOf(char c)Returns theuniquetext instance corresponding to the specified character.static TextvalueOf(char[] chars)Returns the text that contains the characters from the specified array.static TextvalueOf(char[] chars, int offset, int length)Returns the text that contains the characters from the specified subarray of characters.static TextvalueOf(char c, int length)Returns the text that contains a specific length sequence of the character specified.static TextvalueOf(java.lang.CharSequence csq, int start, int end)Returns the text that contains the specified subsequence of characters.static TextvalueOf(double d)Returns the textual representation of the specifieddoubleargument.static TextvalueOf(double value, int digits, boolean scientific, boolean showZero)Returns the textual representation of the specifieddoublevalue according to the specified formatting arguments.static TextvalueOf(float f)Returns the textual representation of the specifiedfloatinstance.static TextvalueOf(int i)Returns the decimal representation of the specifiedintargument.static TextvalueOf(int i, int radix)Returns the radix representation of the specifiedintargument.static TextvalueOf(long l)Returns the decimal representation of the specifiedlongargument.static TextvalueOf(long l, int radix)Returns the radix representation of the specifiedlongargument.static TextvalueOf(java.lang.Object obj)Returns the text representing the specified object.-
Methods inherited from class javolution37.javolution.realtime.RealtimeObject
export, move, moveHeap, preserve, toString, unpreserve
-
-
-
-
Field Detail
-
EMPTY
public static final Text EMPTY
Holds an empty character sequence.
-
NULL
public static final Text NULL
Holds the"null"character sequence.
-
-
Method Detail
-
valueOf
public static Text valueOf(java.lang.Object obj)
Returns the text representing the specified object. If the specified object isnullthis method returnsNULL.- Parameters:
obj- the object to represent as text.- Returns:
- the textual representation of the specified object.
- See Also:
Realtime.toText()
-
valueOf
public static Text valueOf(java.lang.CharSequence csq, int start, int end)
Returns the text that contains the specified subsequence of characters.- Parameters:
csq- the character sequence source.start- the index of the first character.end- the index after the last character.- Returns:
- the corresponding text instance.
- Throws:
java.lang.IndexOutOfBoundsException- if(start < 0) || (end < 0) || (start > end) || (end > csq.length())
-
valueOf
public static Text valueOf(char[] chars)
Returns the text that contains the characters from the specified array.- Parameters:
chars- the array source of the characters.- Returns:
- the corresponding instance.
-
valueOf
public static Text valueOf(char[] chars, int offset, int length)
Returns the text that contains the characters from the specified subarray of characters.- Parameters:
chars- the source of the characters.offset- the index of the first character in the data soure.length- the length of the text returned.- Returns:
- the corresponding instance.
- Throws:
java.lang.IndexOutOfBoundsException- if(offset < 0) || (length < 0) || ((offset + length) > chars.length)
-
valueOf
public static Text valueOf(boolean b)
Returns the text representation of thebooleanargument.- Parameters:
b- aboolean.- Returns:
- if the argument is
true, the text"true"is returned; otherwise, the text"false"is returned.
-
valueOf
public static Text valueOf(char c)
Returns theuniquetext instance corresponding to the specified character.- Parameters:
c- a character.- Returns:
- a text of length
1containing'c'.
-
valueOf
public static Text valueOf(int i)
Returns the decimal representation of the specifiedintargument.- Parameters:
i- theintto format.- Returns:
- the corresponding text instance.
-
valueOf
public static Text valueOf(int i, int radix)
Returns the radix representation of the specifiedintargument.- Parameters:
i- theintto format.radix- the radix (e.g.16for hexadecimal).- Returns:
- the corresponding text instance.
-
valueOf
public static Text valueOf(long l)
Returns the decimal representation of the specifiedlongargument.- Parameters:
l- thelongto format.- Returns:
- the corresponding text instance.
-
valueOf
public static Text valueOf(long l, int radix)
Returns the radix representation of the specifiedlongargument.- Parameters:
l- thelongto format.radix- the radix (e.g.16for hexadecimal).- Returns:
- the corresponding text instance.
-
valueOf
public static Text valueOf(float f)
Returns the textual representation of the specifiedfloatinstance.- Parameters:
f- thefloatto format.- Returns:
- the corresponding text instance. /
-
valueOf
public static Text valueOf(double d)
Returns the textual representation of the specifieddoubleargument.- Parameters:
d- thedoubleto format.- Returns:
- the corresponding text instance. /
-
valueOf
public static Text valueOf(double value, int digits, boolean scientific, boolean showZero)
Returns the textual representation of the specifieddoublevalue according to the specified formatting arguments.- Parameters:
value- thedoublevalue.digits- the number of significative digits (excludes exponent).scientific-trueto forces the use of the scientific notation (e.g.1.23E3);falseotherwise.showZero-trueif trailing fractional zeros are represented;falseotherwise.- Returns:
- the corresponding text instance.
- Throws:
java.lang.IllegalArgumentException- if((digits > 19) || (digits <= 0))) /
-
length
public final int length()
Returns the length of this text.- Specified by:
lengthin interfacejava.lang.CharSequence- Returns:
- the number of characters (16-bits Unicode) composing this text.
-
plus
public final Text plus(java.lang.Object obj)
Returns the concatenation of this text and the textual representation of the specified object.- Parameters:
obj- the object whose textual representation is appended.- Returns:
this.concat(Text.valueOf(obj))
-
concat
public final Text concat(Text that)
Concatenates the specified text to the end of this text. This method is extremely fast (faster even thanStringBuffer.append(String)) and still returns a text instance with an internal binary tree of minimal depth!- Parameters:
that- the text that is concatenated.- Returns:
this + that
-
subtext
public final Text subtext(int start)
Returns a portion of this text.- Parameters:
start- the index of the first character inclusive.- Returns:
- the sub-text starting at the specified position.
- Throws:
java.lang.IndexOutOfBoundsException- if(start < 0) || (start > this.length())
-
insert
public final Text insert(int index, Text txt)
Returns the text having the specified text inserted at the specified location.- Parameters:
index- the insertion position.txt- the text being inserted.- Returns:
subtext(0, index).concat(txt).concat(subtext(index))- Throws:
java.lang.IndexOutOfBoundsException- if(index < 0) || (index > this.length())
-
delete
public final Text delete(int start, int end)
Returns the text without the characters between the specified indexes.- Parameters:
start- the beginning index, inclusive.end- the ending index, exclusive.- Returns:
subtext(0, start).concat(subtext(end))- Throws:
java.lang.IndexOutOfBoundsException- if(start < 0) || (end < 0) || (start > end) || (end > this.length()
-
replace
public final Text replace(Text target, Text replacement)
Replaces each character sequence of this text that matches the specified target sequence with the specified replacement sequence.- Parameters:
target- the text to be replaced.replacement- the replacement text.- Returns:
- the resulting text.
-
subSequence
public final java.lang.CharSequence subSequence(int start, int end)Returnssubtext(start, end).- Specified by:
subSequencein interfacejava.lang.CharSequence- Parameters:
start- the index of the first character inclusive.end- the index of the last character exclusive.- Returns:
this.subtext(start, end)- Throws:
java.lang.IndexOutOfBoundsException- if(start < 0) || (end < 0) || (start > end) || (end > this.length())
-
indexOf
public final int indexOf(java.lang.CharSequence csq)
Returns the index within this text of the first occurrence of the specified character sequence searching forward.- Parameters:
csq- a character sequence.- Returns:
- the index of the first character of the character sequence found;
or
-1if the character sequence is not found.
-
indexOf
public final int indexOf(java.lang.CharSequence csq, int fromIndex)Returns the index within this text of the first occurrence of the specified characters sequence searching forward from the specified index.- Parameters:
csq- a character sequence.fromIndex- the index to start the search from.- Returns:
- the index in the range
[fromIndex, length() - csq.length()]or-1if the character sequence is not found.
-
lastIndexOf
public final int lastIndexOf(java.lang.CharSequence csq)
Returns the index within this text of the last occurrence of the specified characters sequence searching backward.- Parameters:
csq- a character sequence.- Returns:
- the index of the first character of the character sequence found;
or
-1if the character sequence is not found.
-
lastIndexOf
public final int lastIndexOf(java.lang.CharSequence csq, int fromIndex)Returns the index within this text of the last occurrence of the specified character sequence searching backward from the specified index.- Parameters:
csq- a character sequence.fromIndex- the index to start the backward search from.- Returns:
- the index in the range
[0, fromIndex]or-1if the character sequence is not found.
-
startsWith
public final boolean startsWith(java.lang.CharSequence prefix)
Indicates if this text starts with the specified prefix.- Parameters:
prefix- the prefix.- Returns:
trueif the character sequence represented by the argument is a prefix of the character sequence represented by this text;falseotherwise.
-
endsWith
public final boolean endsWith(java.lang.CharSequence suffix)
Indicates if this text ends with the specified suffix.- Parameters:
suffix- the suffix.- Returns:
trueif the character sequence represented by the argument is a suffix of the character sequence represented by this text;falseotherwise.
-
startsWith
public final boolean startsWith(java.lang.CharSequence prefix, int index)Indicates if this text starts with the specified prefix at the specified index.- Parameters:
prefix- the prefix.index- the index of the prefix location in this string.- Returns:
this.substring(index).startsWith(prefix)
-
trim
public final Text trim()
Returns a copy of this text, with leading and trailing whitespace omitted.- Returns:
- a copy of this text with leading and trailing white space removed, or this text if it has no leading or trailing white space.
-
intern
public static Text intern(java.lang.CharSequence csq)
Returns a text equals to the specified character sequence from a pool of unique text instances inImmortalMemory.- Returns:
- an unique text instance allocated in
ImmortalMemory.
-
intern
public static Text intern(java.lang.String str)
Returns a text equals to the specified string from a pool of unique text instances inImmortalMemory.- Returns:
- an unique text instance allocated in
ImmortalMemory.
-
contentEquals
public final boolean contentEquals(java.lang.CharSequence csq)
Indicates if this text has the same character content as the specified character sequence.- Parameters:
csq- the character sequence to compare with.- Returns:
trueif the specified character sequence has the same character content as this text;falseotherwise.
-
contentEqualsIgnoreCase
public final boolean contentEqualsIgnoreCase(java.lang.CharSequence csq)
Indicates if this text has the same character contend as the specified character sequence ignoring case considerations.- Parameters:
csq- theCharSequenceto compare this text against.- Returns:
trueif the argument and this text are equal, ignoring case;falseotherwise.
-
equals
public final boolean equals(java.lang.Object obj)
Compares this text against the specified object for equality. Returnstrueif the specified object is a text having the same character sequence as this text. For generic comparaison with any character sequence thecontentEquals(CharSequence)should be used.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to compare with ornull.- Returns:
trueif that is a text with the same character sequence as this text;falseotherwise.
-
hashCode
public final int hashCode()
Returns the hash code for this text.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code value.
-
compareTo
public final int compareTo(java.lang.Object csq)
Compares this text to another character sequence or string lexicographically.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
csq- the character sequence to be compared.- Returns:
TypeFormat.LEXICAL_COMPARATOR.compare(this, csq)- Throws:
java.lang.ClassCastException- if the specifed object is not aCharSequenceor aString.
-
toText
public final Text toText()
Returnsthis(implementsRealtimeinterface).- Specified by:
toTextin interfaceRealtime- Overrides:
toTextin classRealtimeObject- Returns:
this
-
copy
public final Text copy()
Returns a compact copy of this text allocated on the stack when executing in aPoolContext.- Returns:
- a local compact copy of this text.
-
depth
public abstract int depth()
Returns the depth of the internal tree used to represent this text.- Returns:
- the maximum depth of the text internal binary tree.
-
charAt
public abstract char charAt(int index)
Returns the character at the specified index.- Specified by:
charAtin interfacejava.lang.CharSequence- Parameters:
index- the index of the character.- Returns:
- the character at the specified index.
- Throws:
java.lang.IndexOutOfBoundsException- if(index < 0) || (index >= this.length())
-
indexOf
public abstract int indexOf(char c, int fromIndex)Returns the index within this text of the first occurrence of the specified character, starting the search at the specified index.- Parameters:
c- the character to search for.fromIndex- the index to start the search from.- Returns:
- the index of the first occurrence of the character in this text
that is greater than or equal to
fromIndex, or-1if the character does not occur.
-
lastIndexOf
public abstract int lastIndexOf(char c, int fromIndex)Returns the index within this text of the first occurrence of the specified character, searching backward and starting at the specified index.- Parameters:
c- the character to search for.fromIndex- the index to start the search backward from.- Returns:
- the index of the first occurrence of the character in this text
that is less than or equal to
fromIndex, or-1if the character does not occur.
-
subtext
public abstract Text subtext(int start, int end)
Returns a portion of this text.- Parameters:
start- the index of the first character inclusive.end- the index of the last character exclusive.- Returns:
- the sub-text starting at the specified start position and ending just before the specified end position.
- Throws:
java.lang.IndexOutOfBoundsException- if(start < 0) || (end < 0) || (start > end) || (end > this.length())
-
getChars
public abstract void getChars(int start, int end, char[] dest, int destPos)Copies the characters from this text into the destination character array.- Parameters:
start- the index of the first character to copy.end- the index after the last character to copy.dest- the destination array.destPos- the start offset in the destination array.- Throws:
java.lang.IndexOutOfBoundsException- if(start < 0) || (end < 0) || (start > end) || (end > this.length())
-
toLowerCase
public abstract Text toLowerCase()
Converts the characters of this text to lower case.- Returns:
- the text in lower case.
- See Also:
Character.toLowerCase(char)
-
toUpperCase
public abstract Text toUpperCase()
Converts the characters of this text to upper case.- Returns:
- the text in lower case.
- See Also:
Character.toUpperCase(char)
-
stringValue
public abstract java.lang.String stringValue()
Returns theStringvalue corresponding to this text.- Returns:
- the
java.lang.Stringfor this text.
-
valueOf
public static Text valueOf(char c, int length)
Returns the text that contains a specific length sequence of the character specified.- Parameters:
c- the character to fill this text with.length- the length of the text returned.- Returns:
- the corresponding instance.
- Throws:
java.lang.IndexOutOfBoundsException- if(length < 0)
-
isBlank
public final boolean isBlank()
Indicates if all characters of this text are whitespaces (no characters greater than the space character).- Returns:
trueif this text contains only whitespace.
-
isBlank
public final boolean isBlank(int start, int length)Indicates if the specified sub-range of characters of this text are whitespaces (no characters greater than the space character).- Parameters:
start- the start index.length- the number of characters to inspect.
-
trimStart
public final Text trimStart()
Returns a copy of this text, with leading whitespace omitted.- Returns:
- a copy of this text with leading white space removed, or this text if it has no leading white space.
-
trimEnd
public final Text trimEnd()
Returns a copy of this text, with trailing whitespace omitted.- Returns:
- a copy of this text with trailing white space removed, or this text if it has no trailing white space.
-
padLeft
public final Text padLeft(int len)
Pads this text on the left with spaces to make the minimum total length as specified. The new length of the new text is equal to the original length plus(length()-len)spaces.- Parameters:
len- the total number of characters to make this text equal to.- Returns:
- a new text or the same text if no padding required.
- Throws:
an- IllegalArgumentException if the(len<0).
-
padLeft
public final Text padLeft(int len, char c)
Pads this text on the left to make the minimum total length as specified. Spaces or the given Unicode character are used to pad with.
The new length of the new text is equal to the original length plus(length()-len)pad characters.- Parameters:
len- the total number of characters to make this text equal to.c- the character to pad using.- Returns:
- a new text or the same text if no padding required.
- Throws:
an- IllegalArgumentException if the(len<0).
-
padRight
public final Text padRight(int len)
Pads this text on the right with spaces to make the minimum total length as specified. The new length of the new text is equal to the original length plus(length()-len)spaces.- Parameters:
len- the total number of characters to make this text equal to.- Returns:
- a new text or the same text if no padding required.
- Throws:
an- IllegalArgumentException if the(len<0).
-
padRight
public final Text padRight(int len, char c)
Pads this text on the right to make the minimum total length as specified. Spaces or the given Unicode character are used to pad with.
The new length of the new text is equal to the original length plus(length()-len)pad characters.- Parameters:
len- the total number of characters to make this text equal to.c- the character to pad using.- Returns:
- a new text or the same text if no padding required.
- Throws:
an- IllegalArgumentException if the(len<0).
-
indexOfAny
public final int indexOfAny(CharSet charSet)
Returns the index within this text of the first occurrence of any character in the specified character set.- Parameters:
charSet- the character set.- Returns:
- the index of the first character that matches one of the
characters in the supplied set; or
-1if none.
-
indexOfAny
public final int indexOfAny(CharSet charSet, int start)
Returns the index within a region of this text of the first occurrence of any character in the specified character set.- Parameters:
charSet- the character set.start- the index of the start of the search region in this text.- Returns:
- the index of the first character that matches one of the
characters in the supplied set; or
-1if none.
-
indexOfAny
public final int indexOfAny(CharSet charSet, int start, int length)
Returns the index within a region of this text of the first occurrence of any character in the specified character set.- Parameters:
charSet- the character set.start- the index of the start of the search region in this text.length- the length of the region to search.- Returns:
- the index of the first character that matches one of the
characters in the supplied array; or
-1if none.
-
lastIndexOfAny
public final int lastIndexOfAny(CharSet charSet)
Returns the index within this text of the last occurrence of any character in the specified character set.- Parameters:
charSet- the character set.- Returns:
- the index of the last character that matches one of the
characters in the supplied array; or
-1if none.
-
lastIndexOfAny
public final int lastIndexOfAny(CharSet charSet, int start)
Returns the index within a region of this text of the last occurrence of any character in the specified character set.- Parameters:
charSet- the character set.start- the index of the start of the search region in this text.- Returns:
- the index of the last character that matches one of the
characters in the supplied array; or
-1if none.
-
lastIndexOfAny
public final int lastIndexOfAny(CharSet charSet, int start, int length)
Returns the index within a region of this text of the last occurrence of any character in the specified character set.- Parameters:
charSet- the character set.start- the index of the start of the search region in this text.length- the length of the region to search.- Returns:
- the index of the last character that matches one of the
characters in the supplied array; or
-1if none.
-
-
DMelt 3.0 © DataMelt by jWork.ORG