Enum Class SortedLists.KeyPresentBehavior

java.lang.Object
java.lang.Enum<SortedLists.KeyPresentBehavior>
com.google.common.collect.SortedLists.KeyPresentBehavior
All Implemented Interfaces:
Serializable, Comparable<SortedLists.KeyPresentBehavior>, Constable
Enclosing class:
SortedLists

static enum SortedLists.KeyPresentBehavior extends Enum<SortedLists.KeyPresentBehavior>
A specification for which index to return if the list contains at least one element that compares as equal to the key.
  • Enum Constant Details

    • ANY_PRESENT

      public static final SortedLists.KeyPresentBehavior ANY_PRESENT
      Return the index of any list element that compares as equal to the key. No guarantees are made as to which index is returned, if more than one element compares as equal to the key.
    • LAST_PRESENT

      public static final SortedLists.KeyPresentBehavior LAST_PRESENT
      Return the index of the last list element that compares as equal to the key.
    • FIRST_PRESENT

      public static final SortedLists.KeyPresentBehavior FIRST_PRESENT
      Return the index of the first list element that compares as equal to the key.
    • FIRST_AFTER

      public static final SortedLists.KeyPresentBehavior FIRST_AFTER
      Return the index of the first list element that compares as greater than the key, or list.size() if there is no such element.
    • LAST_BEFORE

      public static final SortedLists.KeyPresentBehavior LAST_BEFORE
      Return the index of the last list element that compares as less than the key, or -1 if there is no such element.
  • Constructor Details

    • KeyPresentBehavior

      private KeyPresentBehavior()
  • Method Details

    • values

      public static SortedLists.KeyPresentBehavior[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SortedLists.KeyPresentBehavior valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • resultIndex

      abstract <E> int resultIndex(Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex)