public enum BufferUtils extends Enum<BufferUtils>
| Modifier and Type | Method and Description |
|---|---|
static ByteBuffer |
duplicate(ByteBuffer b)
Duplicate a
ByteBuffer and preserve the order. |
static boolean |
isSorted(DoubleBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted inside the specified range.
|
static boolean |
isSorted(FloatBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted inside the specified range.
|
static boolean |
isSorted(IntBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted inside the specified range.
|
static boolean |
isSorted(LongBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted inside the specified range.
|
static boolean |
isSortedAndDistinct(DoubleBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted and distinct inside the
specified range.
|
static boolean |
isSortedAndDistinct(FloatBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted and distinct inside the
specified range.
|
static boolean |
isSortedAndDistinct(IntBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted and distinct inside the
specified range.
|
static boolean |
isSortedAndDistinct(LongBuffer b,
int fromIndex,
int toIndex)
Determines if the specified buffer is sorted and distinct inside the
specified range.
|
static ByteBuffer |
slice(ByteBuffer b)
Slice a
ByteBuffer and preserve the order. |
static ByteBuffer |
slice(ByteBuffer b,
int fromIndex,
int toIndex)
Slice a range from the specified
ByteBuffer. |
static BufferUtils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BufferUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static BufferUtils[] values()
for (BufferUtils c : BufferUtils.values()) System.out.println(c);
public static BufferUtils 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 ByteBuffer duplicate(ByteBuffer b)
ByteBuffer and preserve the order. Equivalent to:
b.duplicate().order(b.order())
b - - the buffer to be duplicatedByteBuffer.duplicate(),
ByteBuffer.order()public static ByteBuffer slice(ByteBuffer b)
ByteBuffer and preserve the order. Equivalent to:
b.slice().order(b.order())
b - - the buffer to be slicedByteBuffer.slice(),
ByteBuffer.order()public static ByteBuffer slice(ByteBuffer b, int fromIndex, int toIndex)
ByteBuffer. The buffer's order is
preserved.b - - the buffer to be slicedfromIndex - - the index of the first element in the range (inclusive)toIndex - - the index of the last element in the range (exclusive)IllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()ByteBuffer.slice(),
ByteBuffer.order()public static boolean isSorted(IntBuffer b, int fromIndex, int toIndex)
buffer[i] <= buffer[i + 1] for all elements in the range. A range
of length zero or one is considered sorted.b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSortedAndDistinct(IntBuffer b, int fromIndex, int toIndex)
buffer[i] < buffer[i + 1] for all elements
in the range. A range of length zero or one is considered sorted and
distinct.b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSorted(LongBuffer b, int fromIndex, int toIndex)
buffer[i] <= buffer[i + 1] for all elements in the range. A range
of length zero or one is considered sorted.b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSortedAndDistinct(LongBuffer b, int fromIndex, int toIndex)
buffer[i] < buffer[i + 1] for all elements
in the range. A range of length zero or one is considered sorted and
distinct.b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSorted(FloatBuffer b, int fromIndex, int toIndex)
buffer[i] <= buffer[i + 1] for all elements in the range. A range
of length zero or one is considered sorted. The comparison of two values is
consistent with Float.compareTo(Float).b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSortedAndDistinct(FloatBuffer b, int fromIndex, int toIndex)
buffer[i] < buffer[i + 1] for all elements
in the range. A range of length zero or one is considered sorted and
distinct. The comparison of two values is consistent with
Float.compareTo(Float).b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSorted(DoubleBuffer b, int fromIndex, int toIndex)
buffer[i] <= buffer[i + 1] for all elements in the range. A range
of length zero or one is considered sorted. The comparison of two values is
consistent with Double.compareTo(Double).b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()public static boolean isSortedAndDistinct(DoubleBuffer b, int fromIndex, int toIndex)
buffer[i] < buffer[i + 1] for all elements
in the range. A range of length zero or one is considered sorted and
distinct. The comparison of two values is consistent with
Double.compareTo(Double).b - - the buffer to be checkedfromIndex - - the index of the first element (inclusive) to be checkedtoIndex - - the index of the last element (exclusive) to be checkedIllegalArgumentException - if fromIndex > toIndexIndexOutOfBoundsException - if
fromIndex < 0 or toIndex > b.capacity()Copyright © 2019. All rights reserved.