|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.common.util.CharSequenceUtils
public final class CharSequenceUtils
Utilities related to CharSequence
.
Method Summary | |
---|---|
static int |
compareNullTerminated(CharSequence sequence1,
int sequence1Start,
CharSequence sequence2)
Compares a null-terminated string in one CharSequence with another one. |
static int |
compareNullTerminated(CharSequence sequence1,
int sequence1Start,
CharSequence sequence2,
int sequence2Start)
Compares a null-terminated string in one CharSequence with another one. |
static int |
compareNullTerminated(CharSequence sequence1,
int sequence1Start,
CharSequence sequence2,
int sequence2Start,
int sequence2End)
Compares a null-terminated string in one CharSequence with that in another. |
static boolean |
equals(CharSequence sequence1,
CharSequence sequence2)
Compares the content of two character sequences for equality. |
static boolean |
equalToCapitalized(CharSequence normalizedSequence,
CharSequence comparisonSequence)
Compares the content of two character sequences for equivalence, based on the comparison sequence being equal to the title case version of the normalized sequence. |
static boolean |
equalToUppercase(CharSequence normalizedSequence,
CharSequence comparisonSequence)
Compares the content of two character sequences for equivalence based on the comparison sequence being equal to the uppercase version of the normalized sequence. |
static int |
getNullTerminatedLength(CharSequence sequence,
int start)
Returns the size of the null-terminated String starting at a specific location. |
static IntArrayBuilder |
toCodepoints(CharSequence chars,
int offset,
int length)
Converts a CharSequence to a sequence of Unicode codepoints. |
static IntArrayBuilder |
toCodepoints(CharSequence chars,
int offset,
int length,
int extraCapacity)
Converts a CharSequence to a sequence of Unicode codepoints. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getNullTerminatedLength(CharSequence sequence, int start)
sequence
- The CharSequence being searched.start
- The index to the first character of the String.
start
through (but not including) the first null terminator found.public static int compareNullTerminated(CharSequence sequence1, int sequence1Start, CharSequence sequence2)
sequence1
- The first CharSequence being tested.sequence1Start
- The index into sequence1
indicating the first char in it to be tested.sequence2
- The second CharSequence being tested.
public static int compareNullTerminated(CharSequence sequence1, int sequence1Start, CharSequence sequence2, int sequence2Start)
sequence1
- The first CharSequence being tested.sequence1Start
- The index into sequence1
indicating the first char in it to be tested.sequence2
- The second CharSequence being tested.sequence2Start
- The index into sequence2
indicating the first char in it to be tested.
public static int compareNullTerminated(CharSequence sequence1, int sequence1Start, CharSequence sequence2, int sequence2Start, int sequence2End)
sequence1
- The first CharSequence being tested.sequence1Start
- The index into sequence1
indicating the first char in it to be tested.sequence2
- The second CharSequence being tested.sequence2Start
- The index into sequence2
indicating the first char in it to be tested.sequence2End
- The index into sequence2
indicating the first char in it, after
sequence2Start
, that should NOT be tested.
public static boolean equals(CharSequence sequence1, CharSequence sequence2)
sequence1
- The first sequence to be compared.sequence2
- The second sequence to be compared.
public static boolean equalToUppercase(CharSequence normalizedSequence, CharSequence comparisonSequence)
normalizedSequence
- The normalized or base sequence, usually all lowercase.comparisonSequence
- The second sequence to be compared. The test is whether the characters in this
sequence are all the capitalized versions of the matching character in normalizedSequence
.
public static boolean equalToCapitalized(CharSequence normalizedSequence, CharSequence comparisonSequence)
normalizedSequence
- The normalized or base sequence, usually all lowercase.comparisonSequence
- The second sequence to be compared. The test is whether the characters in this
sequence are the title case versions of the matching character in normalizedSequence
.
public static IntArrayBuilder toCodepoints(CharSequence chars, int offset, int length, int extraCapacity)
chars
- The chars to be converted.offset
- The offset to the first char to be converted.length
- The number of chars to be converted, starting at offset
.extraCapacity
- The number of extra bytes of capacity that should be added to the integer array builder
when it is created.
This is useful in cases where the array may grow after this method completes, and we wish to reduce the number
of array copies.
public static IntArrayBuilder toCodepoints(CharSequence chars, int offset, int length)
chars
- The chars to be converted.offset
- The offset to the first char to be converted.length
- The number of chars to be converted, starting at offset
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |