public class DoubleCircularBuffer extends Object
| Constructor and Description |
|---|
DoubleCircularBuffer(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
double[] |
get(double[] into,
int length) |
double[] |
get(double[] into,
int readPos,
int length) |
double |
get(int readPos) |
static void |
main(String[] args)
meant for testing/illustrating usage
|
boolean |
put(double element)
add new element
|
int |
put(double[] newElements,
int length)
add multiple new elements
|
int |
put(double[] newElements,
int startIndex,
int length)
add multiple new elements
|
int |
remainingCapacity() |
void |
reset()
resets and clears buffer
|
public DoubleCircularBuffer(int capacity)
capacity - maximum capacity of bufferpublic int available()
public double[] get(double[] into,
int length)
into - storage containerlength - number of elements to be readpublic double[] get(double[] into,
int readPos,
int length)
into - storage containerreadPos - circular index (wraps around)length - number of elements to be readpublic double get(int readPos)
readPos - circular index (wraps around)public boolean put(double element)
element - new elementpublic int put(double[] newElements,
int length)
newElements - array of new elementslength - number of elements that are to be written from arraypublic int put(double[] newElements,
int startIndex,
int length)
newElements - array of new elementsstartIndex - 'null'length - number of elements that are to be written from arraypublic int remainingCapacity()
public void reset()
public static void main(String[] args)
args - the command line argumentsCopyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.