Kieker 1.12

kieker.tools.opad.timeseries
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.opad.timeseries.TimeSeriesPointsBuffer<T>
Type Parameters:
T - The type of the buffer.
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.Queue<T>, ITimeSeriesPointsBuffer<T>

public class TimeSeriesPointsBuffer<T>
extends java.util.concurrent.ConcurrentLinkedQueue<T>
implements ITimeSeriesPointsBuffer<T>

This is a thread-safe buffer for time series points, which has or has not a fixed capacity.

Since:
1.10
Author:
Tom Frotscher, Nils Christian Ehmke
See Also:
Serialized Form

Constructor Summary
TimeSeriesPointsBuffer()
          Creates a new instance with infinite capacity.
TimeSeriesPointsBuffer(int capacity)
          Creates a new instance 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.
 void printBuffer()
          print 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
clone, equals, finalize, 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()
Creates a new instance with infinite capacity.


TimeSeriesPointsBuffer

public TimeSeriesPointsBuffer(int capacity)
Creates a new instance with the given capacity. A capacity of less or equal zero means that the capacity is infinite.

Parameters:
capacity - The 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 java.util.Collection<T>
Specified by:
add in interface java.util.Queue<T>
Specified by:
add in interface ITimeSeriesPointsBuffer<T>
Overrides:
add in class java.util.concurrent.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 java.util.Queue<T>
Specified by:
remove in interface ITimeSeriesPointsBuffer<T>
Overrides:
remove in class java.util.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

printBuffer

public void printBuffer()
print buffer.


Kieker 1.12

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