Package gnu.lists
Interface CharSeq
-
- All Superinterfaces:
BoundedHashable,java.lang.CharSequence,java.util.Collection<Char>,Consumable,java.lang.Iterable<Char>,java.util.List<Char>,Sequence<Char>
- All Known Implementing Classes:
CharBuffer,FString
public interface CharSeq extends java.lang.CharSequence, Sequence<Char>, Consumable
A sequence where each element is a character (Unicode code point).
-
-
Field Summary
-
Fields inherited from interface gnu.lists.Sequence
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description charcharAt(int index)The index is in terms of code units.voidgetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)Copy characters into a destination buffer.booleanisEmpty()True is this sequence contains no elements.intlength()Get length of string, in code units (not characters).voidsetCharacterAt(int index, int ch)voidsetCharAt(int index, char ch)java.lang.StringtoString()voidwriteTo(int start, int count, java.lang.Appendable dest)Append a specified subsequence to anAppendable.voidwriteTo(java.lang.Appendable dest)-
Methods inherited from interface gnu.kawa.util.BoundedHashable
boundedHash
-
Methods inherited from interface gnu.lists.Consumable
consume
-
-
-
-
Method Detail
-
length
int length()
Get length of string, in code units (not characters). In contract, size() returns the number of 16-bit code points.- Specified by:
lengthin interfacejava.lang.CharSequence
-
charAt
char charAt(int index)
The index is in terms of code units.- Specified by:
charAtin interfacejava.lang.CharSequence
-
getChars
void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)Copy characters into a destination buffer. Same interface as java.lang.String's getChars.- Parameters:
srcBegin- source start position, in 16-bit code units.srcEnd- source end position, in 16-bit code units.dst- destinationdstBegin- index (in code units) in dst array
-
setCharAt
void setCharAt(int index, char ch)
-
setCharacterAt
void setCharacterAt(int index, int ch)
-
writeTo
void writeTo(int start, int count, java.lang.Appendable dest) throws java.io.IOExceptionAppend a specified subsequence to anAppendable. An allowable implementation is:dest.append(this, start, start+count). Hence implementors ofAppendableshould avoid callingwriteTo- though they can callgetChars.- Throws:
java.io.IOException
-
writeTo
void writeTo(java.lang.Appendable dest) throws java.io.IOException- Throws:
java.io.IOException
-
toString
java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-
-