Kieker 1.9

kieker.tools.tslib
Class TimeSeriesPointsBuffer<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.ConcurrentLinkedQueue<T>
              extended by 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.
 
Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue
contains, isEmpty, iterator, offer, peek, poll, remove, size, toArray, toArray
 
Methods inherited from class java.util.AbstractQueue
addAll, clear, element
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Queue
element
 
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, removeAll, retainAll
 

Constructor Detail

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
Method Detail

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

Kieker 1.9

Copyright 2014 Kieker Project, http://kieker-monitoring.net