Class Buffer<T extends java.lang.Comparable>

  • Type Parameters:
    T - The type held in this buffer
    Direct Known Subclasses:
    StrideTracker

    public abstract class Buffer<T extends java.lang.Comparable>
    extends java.lang.Object
    This is a lightweight buffer implementation that allows for buffer flipping and callbacks when the buffer is full.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.ArrayList<T> data  
    • Constructor Summary

      Constructors 
      Constructor Description
      Buffer​(int size)  
    • Method Summary

      Modifier and Type Method Description
      protected abstract int compare​(T one, T other)  
      java.util.List<T> getFlippedData()  
      protected void onFull()  
      Buffer<T> put​(T element)  
      int remaining()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • data

        protected java.util.ArrayList<T extends java.lang.Comparable> data
    • Constructor Detail

      • Buffer

        public Buffer​(int size)
    • Method Detail

      • onFull

        protected void onFull()
      • compare

        protected abstract int compare​(T one,
                                       T other)
      • remaining

        public int remaining()
      • put

        public Buffer<T> put​(T element)
      • getFlippedData

        public java.util.List<T> getFlippedData()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object