Package org.cip4.jdflib.util
Class FastFiFo<x>
java.lang.Object
org.cip4.jdflib.util.FastFiFo<x>
- Type Parameters:
x- the element class to dump into the fifo
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
FastFiFo
public FastFiFo(int n) - Parameters:
n- size of the fifo
-
-
Method Details
-
push
pushes an element into the back and returns the previous content of the cell- Parameters:
back- the element to push- Returns:
- the element that has been replaced, null if we are not yet full
-
pop
pops the first to go- Returns:
- the first element, null if empty
-
peek
peeks into the fifo from the beginning- Parameters:
i- the index of the element to peek- Returns:
- the object at position i
-
peekArray
peeks into the fifo from the beginning- Returns:
- a snapshot of the current fifo, null if empty
-
toString
-
getFill
public int getFill()- Returns:
- the current number of elements
-
size
public int size()- Returns:
- the maximum total number of elements
-