Package gnu.lists
Interface CharSeq
- All Superinterfaces:
BoundedHashable,CharSequence,Collection<Char>,Consumable,Iterable<Char>,List<Char>,Sequence<Char>,SequencedCollection<Char>
- All Known Implementing Classes:
CharBuffer,FString
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
Modifier and TypeMethodDescriptioncharcharAt(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) toString()voidwriteTo(int start, int count, Appendable dest) Append a specified subsequence to anAppendable.voidwriteTo(Appendable dest) Methods inherited from interface gnu.kawa.util.BoundedHashable
boundedHashMethods inherited from interface java.lang.CharSequence
chars, codePoints, subSequenceMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface gnu.lists.Consumable
consumeMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, getFirst, getLast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, subList, toArray, toArray
-
Method Details
-
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 interfaceCharSequence
-
charAt
char charAt(int index) The index is in terms of code units.- Specified by:
charAtin interfaceCharSequence
-
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
Append 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:
IOException
-
writeTo
- Throws:
IOException
-
toString
String toString()- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
isEmpty
boolean isEmpty()Description copied from interface:SequenceTrue is this sequence contains no elements.
-