Package gnu.lists

Class AbstractCharVector<E>

All Implemented Interfaces:
BoundedHashable, Array<E>, AVector<E>, Consumable, Sequence<E>, Externalizable, Serializable, Comparable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>
Direct Known Subclasses:
CharVector, FString

public abstract class AbstractCharVector<E> extends SimpleVector<E> implements Comparable
See Also:
  • Field Details

    • data

      protected char[] data
    • empty

      protected static char[] empty
  • Constructor Details

    • AbstractCharVector

      public AbstractCharVector()
  • Method Details

    • length

      public int length()
    • getBufferLength

      public int getBufferLength()
      Get the allocated length of the data buffer.
      Specified by:
      getBufferLength in class SimpleVector<E>
    • copyBuffer

      public void copyBuffer(int length)
      Specified by:
      copyBuffer in class SimpleVector<E>
    • ensureBufferLength

      public void ensureBufferLength(int sz)
    • getBuffer

      public char[] getBuffer()
      Specified by:
      getBuffer in class SimpleVector<E>
    • setBuffer

      protected void setBuffer(Object buffer)
      Specified by:
      setBuffer in class SimpleVector<E>
    • charAt

      public final char charAt(int index)
    • getCharRaw

      public final char getCharRaw(int index)
      Specified by:
      getCharRaw in interface Array<E>
      Overrides:
      getCharRaw in class AbstractSequence<E>
    • getChars

      public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
      Copy characters into a destination buffer. Same interface as java.lang.String's getChars.
    • clearBuffer

      protected void clearBuffer(int start, int count)
      Specified by:
      clearBuffer in class SimpleVector<E>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<E>
      Specified by:
      hashCode in interface List<E>
      Overrides:
      hashCode in class AbstractSequence<E>
    • equals

      public abstract boolean equals(Object obj)
      Must override, since we override hashCode.
      Specified by:
      equals in interface Collection<E>
      Specified by:
      equals in interface List<E>
      Overrides:
      equals in class AbstractSequence<E>
    • equals

      public static boolean equals(AbstractCharVector<?> c1, AbstractCharVector<?> c2)
    • compareTo

      public int compareTo(Object obj)
      Specified by:
      compareTo in interface Comparable<E>
    • compareTo

      public static int compareTo(AbstractCharVector<?> cv1, AbstractCharVector<?> cv2, int length)
    • compareTo

      public static int compareTo(char[] arr1, char[] arr2, int length)
    • openReader

      public gnu.kawa.io.CharArrayInPort openReader()
    • openReader

      public gnu.kawa.io.CharArrayInPort openReader(int start, int end)