Class ModCountDeque<T>
java.lang.Object
de.xima.fc.common.collection.ModCountDeque<T>
- Type Parameters:
T- The type of elements in the deque.
- All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, Deque<T>, Queue<T>
A
Deque that keeps track of the number of modifications made to it. The only guarantee is that the
modification increases by some amount when the deque is modified. No guarantees are made about the exact amount by
which the modification counter increases. This class is not thread-safe.- Since:
- 8.2.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c) voidvoidvoidclear()booleanbooleancontainsAll(Collection<?> c) element()booleanvoidgetFirst()getLast()inthashCode()booleanisEmpty()iterator()longmodCount()Gets the number of modifications made to the deque.Gets the counter that keeps track of the number of modifications made to the deque.booleanbooleanofferFirst(T t) booleanpeek()peekLast()poll()pollLast()pop()voidremove()booleanbooleanremoveAll(Collection<?> c) booleanbooleanbooleanbooleanretainAll(Collection<?> c) intsize()stream()Object[]toArray()<T1> T1[]toArray(IntFunction<T1[]> generator) <T1> T1[]toArray(T1[] a) toString()static <V> ModCountDeque<V> Wraps a set in aModCountDequethat keeps track of the number of modifications made to it.static <V> ModCountDeque<V> wrap(Deque<V> set, Counter.LongCounter modCounter) Wraps a deque in aModCountDequethat keeps track of the number of modifications made to it.
-
Method Details
-
add
-
addAll
-
addFirst
-
addLast
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>
-
descendingIterator
- Specified by:
descendingIteratorin interfaceDeque<T>
-
element
-
equals
-
forEach
-
getFirst
-
getLast
-
modCount
public long modCount()Gets the number of modifications made to the deque.- Returns:
- The number of modifications made to the deque.
-
modCounter
Gets the counter that keeps track of the number of modifications made to the deque.- Returns:
- The counter that keeps track of the number of modifications made to the deque.
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classObject
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>
-
iterator
-
offer
-
offerFirst
- Specified by:
offerFirstin interfaceDeque<T>
-
offerLast
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<T>
-
peek
-
peekFirst
-
peekLast
-
poll
-
pollFirst
-
pollLast
-
pop
-
push
-
remove
-
remove
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>
-
removeFirst
- Specified by:
removeFirstin interfaceDeque<T>
-
removeFirstOccurrence
- Specified by:
removeFirstOccurrencein interfaceDeque<T>
-
removeIf
- Specified by:
removeIfin interfaceCollection<T>
-
removeLast
- Specified by:
removeLastin interfaceDeque<T>
-
removeLastOccurrence
- Specified by:
removeLastOccurrencein interfaceDeque<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>
-
size
-
spliterator
- Specified by:
spliteratorin interfaceCollection<T>- Specified by:
spliteratorin interfaceIterable<T>
-
stream
- Specified by:
streamin interfaceCollection<T>
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <T1> T1[] toArray(T1[] a) - Specified by:
toArrayin interfaceCollection<T>
-
toString
-
wrap
Wraps a set in aModCountDequethat keeps track of the number of modifications made to it. May not wrap if already wrapped.- Type Parameters:
V- Value type.- Parameters:
deque- The set to wrap.- Returns:
- The wrapped set.
-
wrap
Wraps a deque in aModCountDequethat keeps track of the number of modifications made to it. May not wrap if already wrapped in a ModCountDeque with the same modCounter.- Type Parameters:
V- Value type.- Parameters:
set- The deque to wrap.modCounter- The modification counter to use.- Returns:
- The wrapped deque.
-