Package gnu.lists

Class ShortVector<E>

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

public abstract class ShortVector<E> extends PrimIntegerVector<E>
Simple adjustable-length vector of signed or unsigned 16-bit integers (shorts).
See Also:
  • Field Details

    • empty

      protected static short[] empty
  • Constructor Details

    • ShortVector

      public ShortVector()
  • Method Details

    • 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>
    • getBuffer

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

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

      public final short getShort(int index)
    • getShortRaw

      public final short getShortRaw(int index)
      Specified by:
      getShortRaw in interface Array<E>
      Overrides:
      getShortRaw in class AbstractSequence<E>
    • setShort

      public final void setShort(int index, short value)
    • setShortRaw

      public final void setShortRaw(int index, short value)
    • add

      public void add(short v)
    • clearBuffer

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