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 TypeMethodDescriptionchar
charAt
(int index) The index is in terms of code units.void
getChars
(int srcBegin, int srcEnd, char[] dst, int dstBegin) Copy characters into a destination buffer.boolean
isEmpty()
True is this sequence contains no elements.int
length()
Get length of string, in code units (not characters).void
setCharacterAt
(int index, int ch) void
setCharAt
(int index, char ch) toString()
void
writeTo
(int start, int count, Appendable dest) Append a specified subsequence to anAppendable
.void
writeTo
(Appendable dest) Methods inherited from interface gnu.kawa.util.BoundedHashable
boundedHash
Methods inherited from interface java.lang.CharSequence
chars, codePoints, subSequence
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface gnu.lists.Consumable
consume
Methods 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:
length
in interfaceCharSequence
-
charAt
char charAt(int index) The index is in terms of code units.- Specified by:
charAt
in 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 ofAppendable
should avoid callingwriteTo
- though they can callgetChars
.- Throws:
IOException
-
writeTo
- Throws:
IOException
-
toString
String toString()- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
isEmpty
boolean isEmpty()Description copied from interface:Sequence
True is this sequence contains no elements.
-