kieker.tools.tslib
Class TimeSeriesPointsBuffer<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.concurrent.ConcurrentLinkedQueue<T>
kieker.tools.tslib.TimeSeriesPointsBuffer<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- Serializable, Iterable<T>, Collection<T>, Queue<T>, ITimeSeriesPointsBuffer<T>
public class TimeSeriesPointsBuffer<T>
- extends ConcurrentLinkedQueue<T>
- implements ITimeSeriesPointsBuffer<T>
This class is using a ConcurrentLinkedQueue to implement a bounded FifoBuffer.
- Since:
- 1.9
- Author:
- Tom Frotscher
- See Also:
- Serialized Form
Constructor Summary |
TimeSeriesPointsBuffer(int cap)
Creates a new TimeSeriesPointsBuffer with the given capacity. |
Method Summary |
boolean |
add(T o)
Add an Object to the tail of the Buffer. |
int |
getSize()
Returns the current size of the buffer. |
T |
remove()
Removes a Value from the buffer in FIFO order. |
TimeSeriesPointsBuffer
public TimeSeriesPointsBuffer(int cap)
- Creates a new TimeSeriesPointsBuffer with the given capacity.
If capacity <= 0, the capacity is infinite.
- Parameters:
cap
- Capacity of the Buffer
add
public boolean add(T o)
- Description copied from interface:
ITimeSeriesPointsBuffer
- Add an Object to the tail of the Buffer.
- Specified by:
add
in interface Collection<T>
- Specified by:
add
in interface ITimeSeriesPointsBuffer<T>
- Overrides:
add
in class ConcurrentLinkedQueue<T>
- Parameters:
o
- The Value to add
- Returns:
- Returns true if Object is added successfully
remove
public T remove()
- Description copied from interface:
ITimeSeriesPointsBuffer
- Removes a Value from the buffer in FIFO order.
- Specified by:
remove
in interface Queue<T>
- Specified by:
remove
in interface ITimeSeriesPointsBuffer<T>
- Overrides:
remove
in class AbstractQueue<T>
- Returns:
- Returns the removed Object
getSize
public int getSize()
- Description copied from interface:
ITimeSeriesPointsBuffer
- Returns the current size of the buffer.
- Specified by:
getSize
in interface ITimeSeriesPointsBuffer<T>
- Returns:
- Returned Buffersize
Copyright 2014 Kieker Project, http://kieker-monitoring.net>