Interface SortedList<E>

Type Parameters:
E - the type of elements in this list
All Superinterfaces:
Iterable<E>, ValueSortedMap.LesserList<E>
All Known Implementing Classes:
RestrictedValueSortedMap.RestrictedSortedList, TreeValueSortedMap.ValueSortedTreeMapValues

public interface SortedList<E> extends ValueSortedMap.LesserList<E>
An interface for sorted lists

This might be better described as a NavigableMultiset; however, I wish for the elements to be retrievable by index, though insertion and mutation is not permitted by index. This implies that though unordered, the underlying implementation has sorted the elements in some way and wishes to expose that ordering to its clients.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    ceilingIndex(E element)
    Returns the least index in this list whose element is greater than or equal to the specified element
    int
    floorIndex(E element)
    Returns the greatest index in this list whose element is less than or equal to the specified element
    int
    higherIndex(E element)
    Returns the least index in this list whose element is strictly greater the specified element
    int
    lowerIndex(E element)
    Returns the greatest index in this list whose element is strictly less than the specified element

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator

    Methods inherited from interface ghidra.generic.util.datastruct.ValueSortedMap.LesserList

    contains, get, indexOf, isEmpty, listIterator, poll, remove, removeAll, size, toList
  • Method Details

    • lowerIndex

      int lowerIndex(E element)
      Returns the greatest index in this list whose element is strictly less than the specified element
      Parameters:
      element - the element to search for
      Returns:
      the index of the found element, or -1
    • floorIndex

      int floorIndex(E element)
      Returns the greatest index in this list whose element is less than or equal to the specified element

      If multiples of the specified element exist, this returns the least index of that element.

      Parameters:
      element - the element to search for
      Returns:
      the index of the found element, or -1
    • ceilingIndex

      int ceilingIndex(E element)
      Returns the least index in this list whose element is greater than or equal to the specified element

      If multiples of the specified element exist, this returns the greatest index of that element.

      Parameters:
      element - the element to search for
      Returns:
      the index of the found element, or -1
    • higherIndex

      int higherIndex(E element)
      Returns the least index in this list whose element is strictly greater the specified element
      Parameters:
      element - the element to search for
      Returns:
      the index of the found element, or -1