Class FastDropLastQueue<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.ConcurrentLinkedQueue<T>
-
- org.bytemechanics.commons.collections.FastDropLastQueue<T>
-
- Type Parameters:
T
- Queue type
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,Queue<T>
public class FastDropLastQueue<T> extends ConcurrentLinkedQueue<T>
Concurrent queue that keeps the same size whatever adds done by droping the extra elements from the head This implementation is very fast but can overflow the initial size- Author:
- afarre
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FastDropLastQueue(int _maxSize)
Builds a new DropLastQueue from the giving _maxSize
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(Collection<? extends T> _c)
void
clear()
boolean
offer(T _e)
T
poll()
boolean
remove(Object _o)
-
Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue
add, contains, forEach, isEmpty, iterator, peek, removeAll, removeIf, retainAll, size, spliterator, toArray, toArray, toString
-
Methods inherited from class java.util.AbstractQueue
element, remove
-
Methods inherited from class java.util.AbstractCollection
containsAll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, parallelStream, stream, toArray
-
-
-
-
Method Detail
-
addAll
public boolean addAll(Collection<? extends T> _c)
- Specified by:
addAll
in interfaceCollection<T>
- Overrides:
addAll
in classConcurrentLinkedQueue<T>
- See Also:
Queue#addAll(java.util.Collection)
-
remove
public boolean remove(Object _o)
- Specified by:
remove
in interfaceCollection<T>
- Overrides:
remove
in classConcurrentLinkedQueue<T>
- See Also:
Queue#remove(java.lang.Object)
-
poll
public T poll()
-
offer
public boolean offer(T _e)
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<T>
- Overrides:
clear
in classConcurrentLinkedQueue<T>
-
-