Package sonia.scm.collect
Class LimitedSortedSet<E>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
com.google.common.collect.ForwardingSet<E>
com.google.common.collect.ForwardingSortedSet<E>
sonia.scm.collect.LimitedSortedSet<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
,SortedSet<E>
public class LimitedSortedSet<E>
extends com.google.common.collect.ForwardingSortedSet<E>
A sorted set which is limited to a specified maximum size. If the maximum
size is reached the last element is removed from the set.
- Since:
- 1.32
-
Constructor Summary
ConstructorsConstructorDescriptionLimitedSortedSet
(int maxSize) Constructs a new set with the specified maximum.LimitedSortedSet
(Comparator<E> comparator, int maxSize) Constructs a new set with the specified comparator and maximum. -
Method Summary
Methods inherited from class com.google.common.collect.ForwardingSortedSet
comparator, first, headSet, last, standardContains, standardRemove, standardSubSet, subSet, tailSet
Methods inherited from class com.google.common.collect.ForwardingSet
equals, hashCode, standardEquals, standardHashCode, standardRemoveAll
Methods inherited from class com.google.common.collect.ForwardingCollection
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContainsAll, standardIsEmpty, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
Methods inherited from class com.google.common.collect.ForwardingObject
toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
Methods inherited from interface java.util.SortedSet
spliterator
-
Constructor Details
-
LimitedSortedSet
public LimitedSortedSet(int maxSize) Constructs a new set with the specified maximum.- Parameters:
maxSize
- maximum size of the set
-
LimitedSortedSet
Constructs a new set with the specified comparator and maximum.- Parameters:
comparator
- comparator to order the setmaxSize
- maximum size of the set
-
-
Method Details
-
add
-
addAll
-
delegate
Returns the underlying delegate set.- Specified by:
delegate
in classcom.google.common.collect.ForwardingSortedSet<E>
- Returns:
- delegate set
-