Package com.complexible.common.collect
Interface ExtendedBufferList<T>
-
- All Superinterfaces:
BufferList<T>
,java.util.Collection<T>
,java.lang.Iterable<T>
public interface ExtendedBufferList<T> extends BufferList<T>
An extension ofBufferList
which can maintain its sorted state and eagerly remove duplicates when elements are inserted.- Since:
- 3.1.1
- Author:
- Pavel Klinov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
filterDuplicates()
Eagerly removes duplicates from the underlying buffer; does not change the relative order of distinct elements.ExtendedBufferList<T>
sort(java.util.Comparator<? super T> theComparator)
com.google.common.collect.PeekingIterator<T>
uniqueIterator()
Lazy elimination of duplicates.-
Methods inherited from interface com.complexible.common.collect.BufferList
add, addAll, array, capacity, clear, getAt, isEmpty, isFull, iterator, size, truncate
-
-
-
-
Method Detail
-
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
ExtendedBufferList<T> sort(java.util.Comparator<? super T> theComparator)
- Specified by:
sort
in interfaceBufferList<T>
-
-