public abstract class BinarySearch<E>
extends java.lang.Object
| Constructor and Description |
|---|
BinarySearch() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
compare(int index,
E element) |
int |
find(E e) |
int |
find(E e,
int low) |
int |
find(E e,
int low,
int high) |
int |
findFirst(E e) |
int |
findFirst(E e,
int low) |
int |
findFirst(E e,
int low,
int high) |
int |
findLast(E e) |
int |
findLast(E e,
int low) |
int |
findLast(E e,
int low,
int high) |
static <T extends java.lang.Comparable<T>> |
forList(java.util.List<T> list) |
static <T> BinarySearch<T> |
forList(java.util.List<T> list,
java.util.Comparator<T> comparator) |
protected abstract int |
getLastIndex() |
public static <T extends java.lang.Comparable<T>> BinarySearch<T> forList(java.util.List<T> list)
public static <T> BinarySearch<T> forList(java.util.List<T> list, java.util.Comparator<T> comparator)
public int find(E e)
public int find(E e, int low)
public int find(E e, int low, int high)
public int findFirst(E e)
public int findFirst(E e, int low)
public int findFirst(E e, int low, int high)
public int findLast(E e)
public int findLast(E e, int low)
public int findLast(E e, int low, int high)
protected abstract int compare(int index,
E element)
protected abstract int getLastIndex()