Package com.complexible.common.collect
Interface ExtendedBufferList<T>
- All Superinterfaces:
BufferList<T>,Collection<T>,Iterable<T>
An extension of
BufferList which can maintain its sorted state and eagerly remove duplicates when elements are inserted.- Since:
- 3.1.1
- Author:
- Pavel Klinov
-
Method Summary
Modifier and TypeMethodDescriptionvoidEagerly removes duplicates from the underlying buffer; does not change the relative order of distinct elements.sort(Comparator<? super T> theComparator) com.google.common.collect.PeekingIterator<T> Lazy elimination of duplicates.Methods inherited from interface com.complexible.common.collect.BufferList
add, addAll, addAll, array, capacity, clear, getAt, isEmpty, isFull, iterator, size, truncateMethods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Method Details
-
filterDuplicates
void filterDuplicates()Eagerly removes duplicates from the underlying buffer; does not change the relative order of distinct elements. Thus filtering duplicates can potentially reduce the size of the list but it will retain any existing ordering. -
uniqueIterator
com.google.common.collect.PeekingIterator<T> uniqueIterator()Lazy elimination of duplicates.sort(Comparator)has to be called prior to this method.- Returns:
- an iterator which lazily eliminates duplicates.
-
sort
- Specified by:
sortin interfaceBufferList<T>
-