calhoun.analysis.crf.solver
Class RecyclingBuffer<T>

java.lang.Object
  extended by calhoun.analysis.crf.solver.RecyclingBuffer<T>

public final class RecyclingBuffer<T>
extends java.lang.Object

Utility class that implements a FIFO buffer with constant time adds, removes, and accesses to any position using a circular buffer in an array.


Field Summary
 T[] array
           
 int currentStart
           
 int length
           
 
Constructor Summary
RecyclingBuffer(T[] arg)
           
 
Method Summary
 T addFirst(T t)
           
 T get(int i)
           
 int getTotalSize()
           
 void set(int i, T val)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

array

public T[] array

length

public int length

currentStart

public int currentStart
Constructor Detail

RecyclingBuffer

public RecyclingBuffer(T[] arg)
Method Detail

get

public final T get(int i)

set

public final void set(int i,
                      T val)

addFirst

public final T addFirst(T t)

getTotalSize

public final int getTotalSize()