net.sf.saxon.tinytree
public final class CharSlice extends Object implements CharSequence, Serializable
Constructor Summary | |
---|---|
CharSlice(char[] array)
Create a CharSlice that maps to the whole of a char[] array | |
CharSlice(char[] array, int start, int length)
Create a CharSlice that maps to a section of a char[] array |
Method Summary | |
---|---|
char | charAt(int index)
Returns the character at the specified index. |
void | copyTo(char[] destination, int destOffset)
Append the contents to another array at a given offset. |
boolean | equals(Object other)
Compare equality |
void | getChars(int start, int end, char[] destination, int destOffset)
Append the contents to another array at a given offset. |
int | hashCode()
Generate a hash code |
int | indexOf(char c)
Get the index of a specific character in the sequence. |
int | length()
Returns the length of this character sequence. |
void | setLength(int length)
Set the length of this character sequence, without changing the array and start offset
to which it is bound |
String | substring(int start, int end)
Returns a new character sequence that is a subsequence of this sequence.
|
CharSequence | subSequence(int start, int end)
Returns a new character sequence that is a subsequence of this sequence.
|
String | toString()
Convert to a string |
void | write(Writer writer)
Write the value to a writer |
Parameters: array the char[] array
Parameters: array the char[] array start position of the first character to be included length number of characters to be included
Parameters: index the index of the character to be returned
Returns: the specified character
Throws: java.lang.IndexOutOfBoundsException if the index argument is negative or not less than length()
Parameters: destination the array to which the characters will be copied destOffset the offset in the target array where the copy will start
Parameters: start offset of first character to be copied end offset of the first character that is not copied destination the array to which the characters will be copied destOffset the offset in the target array where the copy will start
Parameters: c the character to be found
Returns: the position of the first occurrence of that character, or -1 if not found.
Returns: the number of characters in this sequence
Parameters: length the new length of the CharSlice (which must be less than the existing length, though this is not enforced)
Parameters: start position of the first character to be included (relative to the start of the CharSlice, not the underlying array) end position of the first character not to be included (relative to the start of the CharSlice)
Returns: the substring, as a String object
Parameters: start the start index, inclusive end the end index, exclusive
Returns: the specified subsequence
Throws: java.lang.IndexOutOfBoundsException if start or end are negative, if end is greater than length(), or if start is greater than end
Parameters: writer the writer to be written to