public enum BufferSearch extends Enum<BufferSearch>
java.util.Arrays, modified with minimal changes to support nio
buffers.
Supported Buffer Types
| Modifier and Type | Method and Description |
|---|---|
static int |
binarySearch(DoubleBuffer b,
int fromIndex,
int toIndex,
double key)
Copied from
java.util.Arrays |
static int |
binarySearch(FloatBuffer b,
int fromIndex,
int toIndex,
float key)
Copied from
java.util.Arrays |
static int |
binarySearch(IntBuffer b,
int fromIndex,
int toIndex,
int key)
Copied from
java.util.Arrays |
static int |
binarySearch(LongBuffer b,
int fromIndex,
int toIndex,
long key)
Copied from
java.util.Arrays |
static BufferSearch |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BufferSearch[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static BufferSearch[] values()
for (BufferSearch c : BufferSearch.values()) System.out.println(c);
public static BufferSearch valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static int binarySearch(IntBuffer b, int fromIndex, int toIndex, int key)
java.util.Arrays
Searches a range of the specified IntBuffer for the specified value
using the binary search algorithm. The range must be sorted in ascending
order prior to making this call. If it is not sorted, the results are
undefined. If the range contains multiple elements with the specified value,
there is no guarantee which one will be found.
b - the buffer to be searchedfromIndex - the index of the first element (inclusive) to be searchedtoIndex - the index of the last element (exclusive) to be searchedkey - the value to be searched forIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static int binarySearch(LongBuffer b, int fromIndex, int toIndex, long key)
java.util.Arrays
Searches a range of the specified LongBuffer for the specified value
using the binary search algorithm. The range must be sorted in ascending
order prior to making this call. If it is not sorted, the results are
undefined. If the range contains multiple elements with the specified value,
there is no guarantee which one will be found.
b - the buffer to be searchedfromIndex - the index of the first element (inclusive) to be searchedtoIndex - the index of the last element (exclusive) to be searchedkey - the value to be searched forIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static int binarySearch(FloatBuffer b, int fromIndex, int toIndex, float key)
java.util.Arrays
Searches a range of the specified FloatBuffer for the specified value
using the binary search algorithm. The range must be sorted in ascending
order prior to making this call. If it is not sorted, the results are
undefined. If the range contains multiple elements with the specified value,
there is no guarantee which one will be found. This method considers all NaN
values to be equivalent and equal.
b - the buffer to be searchedfromIndex - the index of the first element (inclusive) to be searchedtoIndex - the index of the last element (exclusive) to be searchedkey - the value to be searched forIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static int binarySearch(DoubleBuffer b, int fromIndex, int toIndex, double key)
java.util.Arrays
Searches a range of the specified DoubleBuffer for the specified
value using the binary search algorithm. The range must be sorted in
ascending order prior to making this call. If it is not sorted, the results
are undefined. If the range contains multiple elements with the specified
value, there is no guarantee which one will be found. This method considers
all NaN values to be equivalent and equal.
b - the buffer to be searchedfromIndex - the index of the first element (inclusive) to be searchedtoIndex - the index of the last element (exclusive) to be searchedkey - the value to be searched forIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()Copyright © 2019. All rights reserved.