Package com.complexible.common.collect

# Interface ExtendedBufferList<T>

All Superinterfaces:
  `BufferList<T>`, `Collection<T>`, `Iterable<T>`

public interface ExtendedBufferList<T> extends BufferList<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 Type
  Method
  Description
  `void`
  `filterDuplicates()`
  Eagerly removes duplicates from the underlying buffer; does not change the relative order of distinct elements.
  `ExtendedBufferList<T>`
  `sort(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, addAll, array, capacity, clear, getAt, isEmpty, isFull, iterator, size, truncate`

  ### Methods inherited from interface java.util.Collection

  `addAll, contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

- ## 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

    ExtendedBufferList<T> sort(Comparator<? super T> theComparator)
    Specified by:
      `sort` in interface `BufferList<T>`