Javolution 6.0.0 java
|
Public Member Functions | |
boolean | contains (char c) |
int | indexIn (CharSequence csq) |
int | indexIn (CharSequence csq, int fromIndex) |
int | indexIn (char[] chars) |
int | indexIn (char[] chars, int fromIndex) |
int | lastIndexIn (CharSequence csq) |
int | lastIndexIn (CharSequence csq, int fromIndex) |
int | lastIndexIn (char[] chars) |
int | lastIndexIn (char[] chars, int fromIndex) |
CharSet | plus (CharSet that) |
CharSet | minus (CharSet that) |
String | toString () |
CharSet | value () |
Static Public Member Functions | |
static CharSet | valueOf (char... chars) |
static CharSet | rangeOf (char first, char last) |
Static Public Attributes | |
static final CharSet | EMPTY = new CharSet(new long[0]) |
static final CharSet | WHITESPACES |
static final CharSet | SPACES |
static final CharSet | ISO_CONTROLS |
Private Member Functions | |
CharSet (long[] mapping) | |
CharSet | copy () |
Private Attributes | |
final long[] | _mapping |
A set of characters (typically used for parsing purpose where it is significantly faster than regular expressions for simple patterns). For example: [code] // Integration with Text. Text number; int exponentIndex = num.indexOfAny(CharSet.valueOf('e', 'E'));
// Integration with TextFormat. public List<Integer> parse(CharSequence csq, Cursor cursor) { FastTable<Integer> numbers = FastTable.newInstance(); while (cursor.skip(CharSet.WHITESPACES, csq)) { numbers.add(TypeFormat.parseInt(csq, cursor)); } return numbers; } [/code]
Definition at line 35 of file CharSet.java.
|
private |
Creates a character set with the specified mapping.
mapping | the character set mapping. |
Definition at line 82 of file CharSet.java.
References javolution.text.CharSet._mapping.
Referenced by javolution.text.CharSet.copy(), javolution.text.CharSet.rangeOf(), and javolution.text.CharSet.valueOf().
boolean javolution.text.CharSet.contains | ( | char | c | ) |
Indicates if the specified character is contained by this character set.
c | the character to test. |
true
if this character set contains the specified character; false
otherwise. Definition at line 135 of file CharSet.java.
References javolution.text.CharSet._mapping.
Referenced by javolution.text.Cursor.at(), javolution.text.CharSet.indexIn(), javolution.text.Text.indexOfAny(), javolution.text.CharSet.lastIndexIn(), javolution.text.Text.lastIndexOfAny(), javolution.text.Cursor.nextToken(), javolution.text.Cursor.skipAny(), and javolution.text.CharSet.toString().
|
private |
Returns a copy of this character set.
Definition at line 315 of file CharSet.java.
References javolution.text.CharSet._mapping, and javolution.text.CharSet.CharSet().
Referenced by javolution.text.CharSet.minus(), and javolution.text.CharSet.plus().
int javolution.text.CharSet.indexIn | ( | char[] | chars | ) |
Equivalent to indexIn(chars, 0)
-1
if none found. Definition at line 176 of file CharSet.java.
References javolution.text.CharSet.indexIn().
int javolution.text.CharSet.indexIn | ( | char[] | chars, |
int | fromIndex | ||
) |
Returns the first index in the specified character array of one of the character of this set.
chars | the character array to be searched. |
fromIndex | the index to search from. |
-1
if none found. Definition at line 189 of file CharSet.java.
References javolution.text.CharSet.contains().
int javolution.text.CharSet.indexIn | ( | CharSequence | csq | ) |
Equivalent to indexIn(csq, 0)
csq | the character sequence to be searched. |
-1
if none found. Definition at line 149 of file CharSet.java.
Referenced by javolution.text.CharSet.indexIn().
int javolution.text.CharSet.indexIn | ( | CharSequence | csq, |
int | fromIndex | ||
) |
Returns the first index in the specified character sequence of one of the character of this set.
csq | the character sequence to be searched. |
fromIndex | the index to search from. |
-1
if none found. Definition at line 162 of file CharSet.java.
References javolution.text.CharSet.contains().
int javolution.text.CharSet.lastIndexIn | ( | char[] | chars | ) |
Equivalent to lastIndexIn(chars, chars.length-1)
-1
if none found. Definition at line 234 of file CharSet.java.
References javolution.text.CharSet.lastIndexIn().
int javolution.text.CharSet.lastIndexIn | ( | char[] | chars, |
int | fromIndex | ||
) |
Returns the last index in the specified character array of one of the character of this set.
chars | the character array to be searched. |
fromIndex | the index to search from (backward). |
-1
if none found. Definition at line 247 of file CharSet.java.
References javolution.text.CharSet.contains().
int javolution.text.CharSet.lastIndexIn | ( | CharSequence | csq | ) |
Equivalent to lastIndexIn(csq, csq.length()-1)
csq | the character sequence to be searched. |
-1
if none found. Definition at line 206 of file CharSet.java.
Referenced by javolution.text.CharSet.lastIndexIn().
int javolution.text.CharSet.lastIndexIn | ( | CharSequence | csq, |
int | fromIndex | ||
) |
Returns the last index in the specified character sequence of one of the character of this set.
csq | the character sequence to be searched. |
fromIndex | the index to search from (backward). |
-1
if none found. Definition at line 219 of file CharSet.java.
References javolution.text.CharSet.contains().
Returns the character set containing the characters from this character minus the characters from the character set specified.
that | the set containing the character to be removed. |
this - that
Definition at line 279 of file CharSet.java.
References javolution.text.CharSet._mapping, javolution.text.CharSet.copy(), and javolution.lang.MathLib.min().
Returns the character set containing the characters from this character set plus the characters from the character set specified.
that | the set containing the characters to be added. |
this + that
Definition at line 262 of file CharSet.java.
References javolution.text.CharSet._mapping, javolution.text.CharSet.copy(), and javolution.text.CharSet.plus().
Referenced by javolution.text.CharSet.plus().
|
static |
Returns the character set holding the characters in the specified range.
first | the first character. |
last | the last character. |
IllegalArgumentException | if first > last |
Definition at line 116 of file CharSet.java.
References javolution.text.CharSet._mapping, and javolution.text.CharSet.CharSet().
String javolution.text.CharSet.toString | ( | ) |
Returns the textual representation of this character set.
Definition at line 293 of file CharSet.java.
References javolution.text.CharSet._mapping, javolution.text.TextBuilder.append(), javolution.text.CharSet.contains(), javolution.text.TextBuilder.length(), and javolution.text.TextBuilder.toString().
CharSet javolution.text.CharSet.value | ( | ) |
Returns the constant value held by this object.
Implements javolution.lang.Immutable< T >.
Definition at line 324 of file CharSet.java.
|
static |
Returns the character set holding the specified characters.
chars | the characters contained by this character set. |
Definition at line 92 of file CharSet.java.
References javolution.text.CharSet._mapping, and javolution.text.CharSet.CharSet().
|
private |
Holds the containment mapping.
Definition at line 75 of file CharSet.java.
Referenced by javolution.text.CharSet.CharSet(), javolution.text.CharSet.contains(), javolution.text.CharSet.copy(), javolution.text.CharSet.minus(), javolution.text.CharSet.plus(), javolution.text.CharSet.rangeOf(), javolution.text.CharSet.toString(), and javolution.text.CharSet.valueOf().
Represents an empty character set.
Definition at line 40 of file CharSet.java.
|
static |
Represents ISO control characters according to Java (see Character#isISOControl(char)).
Definition at line 64 of file CharSet.java.
|
static |
Represents spaces characters according to Java (see Character#isSpaceChar(char)).
Definition at line 55 of file CharSet.java.
|
static |
Represents white spaces characters according to Java (see Character#isWhitespace(char)).
Definition at line 46 of file CharSet.java.