T
- the generic typepublic class RingBuffer<T> extends Object
This class is fully thread-safe and reentrant.
Constructor and Description |
---|
RingBuffer(int maxSize)
Instantiates a new ring buffer.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T object)
Adds the.
|
void |
clear()
Clear.
|
int |
count()
Count.
|
T |
getTailItem()
Gets the tail item.
|
boolean |
isEmpty()
Checks if is empty.
|
Iterator<T> |
iterator()
Iterator.
|
protected void |
lockTail()
Lock tail.
|
int |
maxSize()
Max size.
|
T |
remove()
Removes the.
|
void |
remove(int numToRemove)
Removes the.
|
protected void |
unlockTail()
Unlock tail.
|
public RingBuffer(int maxSize)
maxSize
- the max sizepublic void clear()
protected void lockTail()
protected void unlockTail()
public void add(T object)
object
- the objectpublic T getTailItem()
public T remove()
public void remove(int numToRemove)
numToRemove
- the num to removepublic int count()
public int maxSize()
public boolean isEmpty()
Copyright © 2012–2019 tinyMediaManager. All rights reserved.