|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.util.CharSegment
CharSegment is a section of a character buffer
Field Summary | |
protected char[] |
buffer
|
protected int |
length
|
protected int |
offset
|
Constructor Summary | |
CharSegment()
|
|
CharSegment(char[] buffer,
int offset,
int length)
Constructs a char segment based on a char array. |
Method Summary | |
char |
charAt(int i)
Returns the char at the specified offset. |
boolean |
endsWith(CharSegment cb)
Returns true if the CharSegment ends with the char segment. |
boolean |
endsWith(java.lang.String string)
Returns true if the CharSegment ends with the string. |
boolean |
equals(char[] cb,
int length)
Returns true if the CharSegment equals the char array. |
boolean |
equals(CharSegment cb)
Returns true if the two char segments are equal. |
boolean |
equals(java.lang.Object a)
|
boolean |
equalsIgnoreCase(CharSegment b)
Returns true if the two CharSegments are equivalent ignoring the case. |
boolean |
equalsIgnoreCase(java.lang.String a)
Returns true if the CharSegment equals the string. |
char[] |
getBuffer()
Returns the buffer's char array. |
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
Copies characters to the destination buffer. |
char |
getLastChar()
Returns the last character of the buffer |
int |
getLength()
Returns the buffer length |
int |
getOffset()
|
int |
hashCode()
Returns the buffer's hash code |
int |
indexOf(char ch)
Returns the index of a character in the CharSegment. |
int |
indexOf(char ch,
int start)
Returns the index of a character in the CharSegment starting from an offset. |
void |
init(char[] buffer,
int offset,
int length)
Sets the char segment to a new buffer triple. |
int |
lastIndexOf(char ch)
Returns the last index of a character in the CharSegment. |
int |
lastIndexOf(char ch,
int start)
Returns the last index of a character in the CharSegment starting from an offset. |
int |
length()
Returns the character count of the buffer's contents. |
boolean |
matches(java.lang.Object a)
|
boolean |
matches(java.lang.String sa)
Returns true if the charSegment matches the string. |
boolean |
matchesIgnoreCase(java.lang.String sa)
Returns true if the CharSegment matches the string, ignoring the case. |
boolean |
regionMatches(int off1,
CharSegment buf,
int off2,
int len)
|
boolean |
regionMatches(int off1,
java.lang.String buf,
int off2,
int len)
|
boolean |
regionMatchesIgnoreCase(int off1,
CharSegment buf,
int off2,
int len)
|
boolean |
startsWith(java.lang.String string)
Returns true if the CharSegment starts with the string. |
java.lang.String |
substring(int start)
Returns a substring |
java.lang.String |
substring(int start,
int end)
Returns a substring |
CharSegment |
toLowerCase()
Converts the contents of the segment to lower case. |
java.lang.String |
toString()
String representation of the buffer. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected char[] buffer
protected int offset
protected int length
Constructor Detail |
public CharSegment()
public CharSegment(char[] buffer, int offset, int length)
Method Detail |
public void init(char[] buffer, int offset, int length)
public int length()
public int getLength()
public int getOffset()
public char charAt(int i)
public char getLastChar()
IndexOutOfBoundsException
- for an empty bufferpublic char[] getBuffer()
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
public java.lang.String substring(int start)
public java.lang.String substring(int start, int end)
public int indexOf(char ch)
public int indexOf(char ch, int start)
public int lastIndexOf(char ch)
public int lastIndexOf(char ch, int start)
public int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object a)
equals
in class java.lang.Object
public final boolean equals(CharSegment cb)
public final boolean equals(char[] cb, int length)
public final boolean equalsIgnoreCase(java.lang.String a)
public final boolean equalsIgnoreCase(CharSegment b)
public boolean matches(java.lang.Object a)
public boolean matches(java.lang.String sa)
public boolean matchesIgnoreCase(java.lang.String sa)
public boolean regionMatches(int off1, CharSegment buf, int off2, int len)
public boolean regionMatches(int off1, java.lang.String buf, int off2, int len)
public boolean regionMatchesIgnoreCase(int off1, CharSegment buf, int off2, int len)
public boolean startsWith(java.lang.String string)
public boolean endsWith(java.lang.String string)
public boolean endsWith(CharSegment cb)
public CharSegment toLowerCase()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |