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

public interface CharSeq extends CharSequence, Sequence<Char>, Consumable
A sequence where each element is a character (Unicode code point).
  • 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 interface CharSequence
    • charAt

      char charAt(int index)
      The index is in terms of code units.
      Specified by:
      charAt in interface 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 - destination
      dstBegin - 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, Appendable dest) throws IOException
      Append a specified subsequence to an Appendable. An allowable implementation is: dest.append(this, start, start+count). Hence implementors of Appendable should avoid calling writeTo - though they can call getChars.
      Throws:
      IOException
    • writeTo

      void writeTo(Appendable dest) throws IOException
      Throws:
      IOException
    • toString

      String toString()
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object
    • isEmpty

      boolean isEmpty()
      Description copied from interface: Sequence
      True is this sequence contains no elements.
      Specified by:
      isEmpty in interface CharSequence
      Specified by:
      isEmpty in interface Collection<Char>
      Specified by:
      isEmpty in interface List<Char>
      Specified by:
      isEmpty in interface Sequence<Char>