com.liferay.portal.kernel.util
Class BinarySearch<E>
java.lang.Object
com.liferay.portal.kernel.util.BinarySearch<E>
public abstract class BinarySearch<E>
- extends Object
Method Summary |
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
|
forList(List<T> list)
|
static
|
forList(List<T> list,
Comparator<T> comparator)
|
protected abstract int |
getLastIndex()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinarySearch
public BinarySearch()
forList
public static <T extends Comparable<T>> BinarySearch<T> forList(List<T> list)
forList
public static <T> BinarySearch<T> forList(List<T> list,
Comparator<T> comparator)
find
public int find(E e)
find
public int find(E e,
int low)
find
public int find(E e,
int low,
int high)
findFirst
public int findFirst(E e)
findFirst
public int findFirst(E e,
int low)
findFirst
public int findFirst(E e,
int low,
int high)
findLast
public int findLast(E e)
findLast
public int findLast(E e,
int low)
findLast
public int findLast(E e,
int low,
int high)
compare
protected abstract int compare(int index,
E element)
getLastIndex
protected abstract int getLastIndex()