public final class TextUtil extends Object
Utility class for char[] operations (mainly matching/comparing)
Modifier and Type | Method and Description |
---|---|
static int |
binarySearch(boolean caseSensitive,
char[][] values,
char[] text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
char[][] values,
CharSequence text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
char[][] values,
int valuesOffset,
int valuesLen,
char[] text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
char[][] values,
int valuesOffset,
int valuesLen,
CharSequence text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
CharSequence[] values,
char[] text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
CharSequence[] values,
CharSequence text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
CharSequence[] values,
int valuesOffset,
int valuesLen,
char[] text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
binarySearch(boolean caseSensitive,
CharSequence[] values,
int valuesOffset,
int valuesLen,
CharSequence text,
int textOffset,
int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an
(offset,len) specification— using the binary search algorithm.
|
static int |
compareTo(boolean caseSensitive,
char[] text1,
char[] text2)
Compares two texts lexicographically.
|
static int |
compareTo(boolean caseSensitive,
char[] text1,
int text1Offset,
int text1Len,
char[] text2,
int text2Offset,
int text2Len)
Compares two texts lexicographically.
|
static int |
compareTo(boolean caseSensitive,
CharSequence text1,
char[] text2)
Compares two texts lexicographically.
|
static int |
compareTo(boolean caseSensitive,
CharSequence text1,
CharSequence text2)
Compares two texts lexicographically.
|
static int |
compareTo(boolean caseSensitive,
CharSequence text1,
int text1Offset,
int text1Len,
char[] text2,
int text2Offset,
int text2Len)
Compares two texts lexicographically.
|
static int |
compareTo(boolean caseSensitive,
CharSequence text1,
int text1Offset,
int text1Len,
CharSequence text2,
int text2Offset,
int text2Len)
Compares two texts lexicographically.
|
static boolean |
contains(boolean caseSensitive,
char[] text,
char[] fragment)
Checks whether a text contains a specific fragment.
|
static boolean |
contains(boolean caseSensitive,
char[] text,
int textOffset,
int textLen,
char[] fragment,
int fragmentOffset,
int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
contains(boolean caseSensitive,
char[] text,
int textOffset,
int textLen,
CharSequence fragment,
int fragmentOffset,
int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
contains(boolean caseSensitive,
CharSequence text,
char[] fragment)
Checks whether a text contains a specific fragment.
|
static boolean |
contains(boolean caseSensitive,
CharSequence text,
CharSequence fragment)
Checks whether a text contains a specific fragment.
|
static boolean |
contains(boolean caseSensitive,
CharSequence text,
int textOffset,
int textLen,
char[] fragment,
int fragmentOffset,
int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
contains(boolean caseSensitive,
CharSequence text,
int textOffset,
int textLen,
CharSequence fragment,
int fragmentOffset,
int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
endsWith(boolean caseSensitive,
char[] text,
char[] suffix)
Checks whether a text ends with a specified suffix.
|
static boolean |
endsWith(boolean caseSensitive,
char[] text,
int textOffset,
int textLen,
char[] suffix,
int suffixOffset,
int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
endsWith(boolean caseSensitive,
char[] text,
int textOffset,
int textLen,
CharSequence suffix,
int suffixOffset,
int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
endsWith(boolean caseSensitive,
CharSequence text,
char[] suffix)
Checks whether a text ends with a specified suffix.
|
static boolean |
endsWith(boolean caseSensitive,
CharSequence text,
CharSequence suffix)
Checks whether a text ends with a specified suffix.
|
static boolean |
endsWith(boolean caseSensitive,
CharSequence text,
int textOffset,
int textLen,
char[] suffix,
int suffixOffset,
int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
endsWith(boolean caseSensitive,
CharSequence text,
int textOffset,
int textLen,
CharSequence suffix,
int suffixOffset,
int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
equals(boolean caseSensitive,
char[] text1,
char[] text2)
Check equality between two char[] objects.
|
static boolean |
equals(boolean caseSensitive,
char[] text1,
int text1Offset,
int text1Len,
char[] text2,
int text2Offset,
int text2Len)
Check equality between two char[] objects, specifying (offset,len) pairs for limiting
the fragments to be checked.
|
static boolean |
equals(boolean caseSensitive,
CharSequence text1,
char[] text2)
Check equality between a CharSequence and a char[] object.
|
static boolean |
equals(boolean caseSensitive,
CharSequence text1,
CharSequence text2)
Check equality of two CharSequence objects.
|
static boolean |
equals(boolean caseSensitive,
CharSequence text1,
int text1Offset,
int text1Len,
char[] text2,
int text2Offset,
int text2Len)
Check equality between a CharSequence and a char[] object, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
equals(boolean caseSensitive,
CharSequence text1,
int text1Offset,
int text1Len,
CharSequence text2,
int text2Offset,
int text2Len)
Check equality between two CharSequence objects, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static int |
hashCode(char[] text,
int textOffset,
int textLen) |
static int |
hashCode(CharSequence text) |
static int |
hashCode(CharSequence text0,
CharSequence text1) |
static int |
hashCode(CharSequence text0,
CharSequence text1,
CharSequence text2) |
static int |
hashCode(CharSequence text0,
CharSequence text1,
CharSequence text2,
CharSequence text3) |
static int |
hashCode(CharSequence text0,
CharSequence text1,
CharSequence text2,
CharSequence text3,
CharSequence text4) |
static int |
hashCode(CharSequence text,
int beginIndex,
int endIndex) |
static boolean |
startsWith(boolean caseSensitive,
char[] text,
char[] prefix)
Checks whether a text starts with a specified prefix.
|
static boolean |
startsWith(boolean caseSensitive,
char[] text,
int textOffset,
int textLen,
char[] prefix,
int prefixOffset,
int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
startsWith(boolean caseSensitive,
char[] text,
int textOffset,
int textLen,
CharSequence prefix,
int prefixOffset,
int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
startsWith(boolean caseSensitive,
CharSequence text,
char[] prefix)
Checks whether a text starts with a specified prefix.
|
static boolean |
startsWith(boolean caseSensitive,
CharSequence text,
CharSequence prefix)
Checks whether a text starts with a specified prefix.
|
static boolean |
startsWith(boolean caseSensitive,
CharSequence text,
int textOffset,
int textLen,
char[] prefix,
int prefixOffset,
int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
static boolean |
startsWith(boolean caseSensitive,
CharSequence text,
int textOffset,
int textLen,
CharSequence prefix,
int prefixOffset,
int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs
for limiting the fragments to be checked.
|
public static boolean equals(boolean caseSensitive, CharSequence text1, CharSequence text2)
Check equality of two CharSequence objects. This is equivalent to String.equals(Object)
and String.equalsIgnoreCase(String)
.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text2
- the second text to be compared.public static boolean equals(boolean caseSensitive, CharSequence text1, char[] text2)
Check equality between a CharSequence and a char[] object.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text2
- the second text to be compared.public static boolean equals(boolean caseSensitive, char[] text1, char[] text2)
Check equality between two char[] objects.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text2
- the second text to be compared.public static boolean equals(boolean caseSensitive, char[] text1, int text1Offset, int text1Len, char[] text2, int text2Offset, int text2Len)
Check equality between two char[] objects, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text1Offset
- the offset of the first text.text1Len
- the length of the first text.text2
- the second text to be compared.text2Offset
- the offset of the second text.text2Len
- the length of the second text.public static boolean equals(boolean caseSensitive, CharSequence text1, int text1Offset, int text1Len, char[] text2, int text2Offset, int text2Len)
Check equality between a CharSequence and a char[] object, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text1Offset
- the offset of the first text.text1Len
- the length of the first text.text2
- the second text to be compared.text2Offset
- the offset of the second text.text2Len
- the length of the second text.public static boolean equals(boolean caseSensitive, CharSequence text1, int text1Offset, int text1Len, CharSequence text2, int text2Offset, int text2Len)
Check equality between two CharSequence objects, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text1Offset
- the offset of the first text.text1Len
- the length of the first text.text2
- the second text to be compared.text2Offset
- the offset of the second text.text2Len
- the length of the second text.public static boolean startsWith(boolean caseSensitive, CharSequence text, CharSequence prefix)
Checks whether a text starts with a specified prefix.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.prefix
- the prefix to be searched.public static boolean startsWith(boolean caseSensitive, CharSequence text, char[] prefix)
Checks whether a text starts with a specified prefix.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.prefix
- the prefix to be searched.public static boolean startsWith(boolean caseSensitive, char[] text, char[] prefix)
Checks whether a text starts with a specified prefix.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.prefix
- the prefix to be searched.public static boolean startsWith(boolean caseSensitive, char[] text, int textOffset, int textLen, char[] prefix, int prefixOffset, int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.textOffset
- the offset of the text.textLen
- the length of the text.prefix
- the prefix to be searched.prefixOffset
- the offset of the prefix.prefixLen
- the length of the prefix.public static boolean startsWith(boolean caseSensitive, CharSequence text, int textOffset, int textLen, char[] prefix, int prefixOffset, int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.textOffset
- the offset of the text.textLen
- the length of the text.prefix
- the prefix to be searched.prefixOffset
- the offset of the prefix.prefixLen
- the length of the prefix.public static boolean startsWith(boolean caseSensitive, char[] text, int textOffset, int textLen, CharSequence prefix, int prefixOffset, int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.textOffset
- the offset of the text.textLen
- the length of the text.prefix
- the prefix to be searched.prefixOffset
- the offset of the prefix.prefixLen
- the length of the prefix.public static boolean startsWith(boolean caseSensitive, CharSequence text, int textOffset, int textLen, CharSequence prefix, int prefixOffset, int prefixLen)
Checks whether a text starts with a specified prefix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for prefixes.textOffset
- the offset of the text.textLen
- the length of the text.prefix
- the prefix to be searched.prefixOffset
- the offset of the prefix.prefixLen
- the length of the prefix.public static boolean endsWith(boolean caseSensitive, CharSequence text, CharSequence suffix)
Checks whether a text ends with a specified suffix.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.suffix
- the suffix to be searched.public static boolean endsWith(boolean caseSensitive, CharSequence text, char[] suffix)
Checks whether a text ends with a specified suffix.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.suffix
- the suffix to be searched.public static boolean endsWith(boolean caseSensitive, char[] text, char[] suffix)
Checks whether a text ends with a specified suffix.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.suffix
- the suffix to be searched.public static boolean endsWith(boolean caseSensitive, char[] text, int textOffset, int textLen, char[] suffix, int suffixOffset, int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.textOffset
- the offset of the text.textLen
- the length of the text.suffix
- the suffix to be searched.suffixOffset
- the offset of the suffix.suffixLen
- the length of the suffix.public static boolean endsWith(boolean caseSensitive, CharSequence text, int textOffset, int textLen, char[] suffix, int suffixOffset, int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.textOffset
- the offset of the text.textLen
- the length of the text.suffix
- the suffix to be searched.suffixOffset
- the offset of the suffix.suffixLen
- the length of the suffix.public static boolean endsWith(boolean caseSensitive, char[] text, int textOffset, int textLen, CharSequence suffix, int suffixOffset, int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.textOffset
- the offset of the text.textLen
- the length of the text.suffix
- the suffix to be searched.suffixOffset
- the offset of the suffix.suffixLen
- the length of the suffix.public static boolean endsWith(boolean caseSensitive, CharSequence text, int textOffset, int textLen, CharSequence suffix, int suffixOffset, int suffixLen)
Checks whether a text ends with a specified suffix, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for suffixes.textOffset
- the offset of the text.textLen
- the length of the text.suffix
- the suffix to be searched.suffixOffset
- the offset of the suffix.suffixLen
- the length of the suffix.public static boolean contains(boolean caseSensitive, CharSequence text, CharSequence fragment)
Checks whether a text contains a specific fragment.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.fragment
- the fragment to be searched.public static boolean contains(boolean caseSensitive, CharSequence text, char[] fragment)
Checks whether a text contains a specific fragment.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.fragment
- the fragment to be searched.public static boolean contains(boolean caseSensitive, char[] text, char[] fragment)
Checks whether a text contains a specific fragment.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.fragment
- the fragment to be searched.public static boolean contains(boolean caseSensitive, char[] text, int textOffset, int textLen, char[] fragment, int fragmentOffset, int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.textOffset
- the offset of the text.textLen
- the length of the text.fragment
- the fragment to be searched.fragmentOffset
- the offset of the fragment.fragmentLen
- the length of the fragment.public static boolean contains(boolean caseSensitive, CharSequence text, int textOffset, int textLen, char[] fragment, int fragmentOffset, int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.textOffset
- the offset of the text.textLen
- the length of the text.fragment
- the fragment to be searched.fragmentOffset
- the offset of the fragment.fragmentLen
- the length of the fragment.public static boolean contains(boolean caseSensitive, char[] text, int textOffset, int textLen, CharSequence fragment, int fragmentOffset, int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.textOffset
- the offset of the text.textLen
- the length of the text.fragment
- the fragment to be searched.fragmentOffset
- the offset of the fragment.fragmentLen
- the length of the fragment.public static boolean contains(boolean caseSensitive, CharSequence text, int textOffset, int textLen, CharSequence fragment, int fragmentOffset, int fragmentLen)
Checks whether a text contains a specific fragment, specifying (offset,len) pairs for limiting the fragments to be checked.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text
- the text to be checked for fragments.textOffset
- the offset of the text.textLen
- the length of the text.fragment
- the fragment to be searched.fragmentOffset
- the offset of the fragment.fragmentLen
- the length of the fragment.public static int compareTo(boolean caseSensitive, CharSequence text1, CharSequence text2)
Compares two texts lexicographically.
The comparison is based on the Unicode value of each character in the CharSequences. The character sequence represented by the first text object is compared lexicographically to the character sequence represented by the second text.
The result is a negative integer if the first text lexicographically precedes the second text. The result is a positive integer if the first text lexicographically follows the second text. The result is zero if the texts are equal.
This method works in a way equivalent to that of the String.compareTo(String)
and String.compareToIgnoreCase(String)
methods.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text2
- the second text to be compared.public static int compareTo(boolean caseSensitive, CharSequence text1, char[] text2)
Compares two texts lexicographically.
The comparison is based on the Unicode value of each character in the CharSequences. The character sequence represented by the first text object is compared lexicographically to the character sequence represented by the second text.
The result is a negative integer if the first text lexicographically precedes the second text. The result is a positive integer if the first text lexicographically follows the second text. The result is zero if the texts are equal.
This method works in a way equivalent to that of the String.compareTo(String)
and String.compareToIgnoreCase(String)
methods.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text2
- the second text to be compared.public static int compareTo(boolean caseSensitive, char[] text1, char[] text2)
Compares two texts lexicographically.
The comparison is based on the Unicode value of each character in the CharSequences. The character sequence represented by the first text object is compared lexicographically to the character sequence represented by the second text.
The result is a negative integer if the first text lexicographically precedes the second text. The result is a positive integer if the first text lexicographically follows the second text. The result is zero if the texts are equal.
This method works in a way equivalent to that of the String.compareTo(String)
and String.compareToIgnoreCase(String)
methods.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text2
- the second text to be compared.public static int compareTo(boolean caseSensitive, char[] text1, int text1Offset, int text1Len, char[] text2, int text2Offset, int text2Len)
Compares two texts lexicographically.
The comparison is based on the Unicode value of each character in the CharSequences. The character sequence represented by the first text object is compared lexicographically to the character sequence represented by the second text.
The result is a negative integer if the first text lexicographically precedes the second text. The result is a positive integer if the first text lexicographically follows the second text. The result is zero if the texts are equal.
This method works in a way equivalent to that of the String.compareTo(String)
and String.compareToIgnoreCase(String)
methods.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text1Offset
- the offset of the first text.text1Len
- the length of the first text.text2
- the second text to be compared.text2Offset
- the offset of the second text.text2Len
- the length of the second text.public static int compareTo(boolean caseSensitive, CharSequence text1, int text1Offset, int text1Len, char[] text2, int text2Offset, int text2Len)
Compares two texts lexicographically.
The comparison is based on the Unicode value of each character in the CharSequences. The character sequence represented by the first text object is compared lexicographically to the character sequence represented by the second text.
The result is a negative integer if the first text lexicographically precedes the second text. The result is a positive integer if the first text lexicographically follows the second text. The result is zero if the texts are equal.
This method works in a way equivalent to that of the String.compareTo(String)
and String.compareToIgnoreCase(String)
methods.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text1Offset
- the offset of the first text.text1Len
- the length of the first text.text2
- the second text to be compared.text2Offset
- the offset of the second text.text2Len
- the length of the second text.public static int compareTo(boolean caseSensitive, CharSequence text1, int text1Offset, int text1Len, CharSequence text2, int text2Offset, int text2Len)
Compares two texts lexicographically.
The comparison is based on the Unicode value of each character in the CharSequences. The character sequence represented by the first text object is compared lexicographically to the character sequence represented by the second text.
The result is a negative integer if the first text lexicographically precedes the second text. The result is a positive integer if the first text lexicographically follows the second text. The result is zero if the texts are equal.
This method works in a way equivalent to that of the String.compareTo(String)
and String.compareToIgnoreCase(String)
methods.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.text1
- the first text to be compared.text1Offset
- the offset of the first text.text1Len
- the length of the first text.text2
- the second text to be compared.text2Offset
- the offset of the second text.text2Len
- the length of the second text.public static int binarySearch(boolean caseSensitive, char[][] values, char[] text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, char[][] values, CharSequence text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, CharSequence[] values, char[] text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, CharSequence[] values, CharSequence text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, char[][] values, int valuesOffset, int valuesLen, char[] text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.valuesOffset
- the offset to be applied to the texts array so that search only takes part in a fragment
of it.valuesLen
- the length of the fragment of the texts array in which search will take part.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, char[][] values, int valuesOffset, int valuesLen, CharSequence text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.valuesOffset
- the offset to be applied to the texts array so that search only takes part in a fragment
of it.valuesLen
- the length of the fragment of the texts array in which search will take part.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, CharSequence[] values, int valuesOffset, int valuesLen, char[] text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.valuesOffset
- the offset to be applied to the texts array so that search only takes part in a fragment
of it.valuesLen
- the length of the fragment of the texts array in which search will take part.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int binarySearch(boolean caseSensitive, CharSequence[] values, int valuesOffset, int valuesLen, CharSequence text, int textOffset, int textLen)
Searches the specified array of texts (values) for the specified text —or a fragment, using an (offset,len) specification— using the binary search algorithm.
Note the specified values parameter must be lexicographically ordered.
caseSensitive
- whether the comparison must be done in a case-sensitive or case-insensitive way.values
- the array of texts inside which the specified text will be searched.
Note that it must be ordered.valuesOffset
- the offset to be applied to the texts array so that search only takes part in a fragment
of it.valuesLen
- the length of the fragment of the texts array in which search will take part.text
- the text to search.textOffset
- the offset of the text to search.textLen
- the length of the text to search.public static int hashCode(char[] text, int textOffset, int textLen)
public static int hashCode(CharSequence text)
public static int hashCode(CharSequence text, int beginIndex, int endIndex)
public static int hashCode(CharSequence text0, CharSequence text1)
public static int hashCode(CharSequence text0, CharSequence text1, CharSequence text2)
public static int hashCode(CharSequence text0, CharSequence text1, CharSequence text2, CharSequence text3)
public static int hashCode(CharSequence text0, CharSequence text1, CharSequence text2, CharSequence text3, CharSequence text4)
Copyright © 2015 The ATTOPARSER team. All rights reserved.