Interface SortableList<E>

Type Parameters:
E -
All Superinterfaces:
Collection<E>, Iterable<E>, List<E>
All Known Implementing Classes:
ObservableListWrapper, ObservableSequentialListWrapper, TrackableObservableList

public interface SortableList<E> extends List<E>
SortableList is a list that can sort itself in an efficient way, in contrast to the Collections.sort() method which threat all lists the same way. E.g. ObservableList can sort and fire only one notification.
  • Method Details

    • sort

      void sort()
      Sort using default comparator
      Throws:
      ClassCastException - if some of the elements cannot be cast to Comparable
      UnsupportedOperationException - if list's iterator doesn't support set
    • sort

      void sort(Comparator<? super E> comparator)
      Sort using comparator
      Specified by:
      sort in interface List<E>
      Parameters:
      comparator - the comparator to use
      Throws:
      ClassCastException - if the list contains elements that are not mutually comparable using the specified comparator.
      UnsupportedOperationException - if the specified list's list-iterator does not support the set operation.