public interface PointedCharSequence
extends java.lang.CharSequence
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.String anotherString)
Compares the sequence and the string lexicographically.
|
long |
getLastBytePosition()
Position of the last byte of this sequence in the file (exclusive).
|
int |
indexOf(java.lang.String str)
Returns the index within this sequence of the first occurrence of the specified substring.
|
long getLastBytePosition()
int indexOf(java.lang.String str)
The returned index is the smallest value k for which:
If no such value of k exists, thenthis.startsWith(str, k)
-1
is returned.str
- the substring to search for.-1
if there is no such occurrence.int compareTo(java.lang.String anotherString)
compareTo
returns 0
exactly when
the equals(Object) method would return true
.
This is the definition of lexicographic ordering. If two strings are
different, then either they have different characters at some index
that is a valid index for both strings, or their lengths are different,
or both. If they have different characters at one or more index
positions, let k be the smallest such index; then the string
whose character at position k has the smaller value, as
determined by using the < operator, lexicographically precedes the
other string. In this case, compareTo
returns the
difference of the two character values at position k
in
the two string -- that is, the value:
If there is no index position at which they differ, then the shorter string lexicographically precedes the longer string. In this case,this.charAt(k)-anotherString.charAt(k)
compareTo
returns the difference of the lengths of the
strings -- that is, the value:
this.length()-anotherString.length()
anotherString
- the String
to be compared.0
if the argument string is equal to
this string; a value less than 0
if this string
is lexicographically less than the string argument; and a
value greater than 0
if this string is
lexicographically greater than the string argument.