Class ModCountSet<V>
java.lang.Object
de.xima.fc.common.collection.ModCountSet<V>
- Type Parameters:
V- Type of the elements in the set.
- All Implemented Interfaces:
Serializable, Iterable<V>, Collection<V>, Set<V>
A set 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 V> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanvoidinthashCode()booleanisEmpty()iterator()longmodCount()Gets the number of modifications made to this set.Gets the modification counter.booleanbooleanremoveAll(Collection<?> c) booleanbooleanretainAll(Collection<?> c) intsize()stream()Object[]toArray()<T> T[]toArray(IntFunction<T[]> generator) <T> T[]toArray(T[] a) toString()static <V> ModCountSet<V> Wraps a set in aModCountSetthat keeps track of the number of modifications made to it.static <V> ModCountSet<V> wrap(Set<V> set, Counter.LongCounter modCounter) Wraps a set in aModCountSetthat keeps track of the number of modifications made to it.
-
Method Details
-
add
-
addAll
-
clear
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<V>- Specified by:
containsAllin interfaceSet<V>
-
equals
-
forEach
-
hashCode
-
isEmpty
-
iterator
-
modCount
public long modCount()Gets the number of modifications made to this set.- Returns:
- The number of modifications made to this set.
-
modCounter
Gets the modification counter.- Returns:
- The modification counter.
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<V>
-
remove
-
removeAll
-
removeIf
- Specified by:
removeIfin interfaceCollection<V>
-
retainAll
-
size
-
spliterator
- Specified by:
spliteratorin interfaceCollection<V>- Specified by:
spliteratorin interfaceIterable<V>- Specified by:
spliteratorin interfaceSet<V>
-
stream
- Specified by:
streamin interfaceCollection<V>
-
toArray
-
toArray
-
toArray
- Specified by:
toArrayin interfaceCollection<V>
-
toString
-
wrap
Wraps a set in aModCountSetthat keeps track of the number of modifications made to it. May not wrap if already wrapped.- Type Parameters:
V- Value type.- Parameters:
set- The set to wrap.- Returns:
- The wrapped set.
-
wrap
Wraps a set in aModCountSetthat keeps track of the number of modifications made to it. May not wrap if already wrapped in a ModCountSet with the same modCounter.- Type Parameters:
V- Value type.- Parameters:
set- The set to wrap.modCounter- The modification counter to use.- Returns:
- The wrapped set.
-