public abstract class DoubleBuffer extends Buffer implements Comparable<DoubleBuffer>
This class defines four categories of operations upon double buffers:
Absolute and relative get and
put methods that read and write
single doubles;
Relative bulk get
methods that transfer contiguous sequences of doubles from this buffer
into an array; and
Relative bulk put
methods that transfer contiguous sequences of doubles from a
double array or some other double
buffer into this buffer; and
Methods for compacting, duplicating, and slicing
a double buffer.
Double buffers can be created either by allocation, which allocates space for the buffer's
content, by wrapping an existing
double array into a buffer, or by creating a
view of an existing byte buffer.
Like a byte buffer, a double buffer is either direct or non-direct. A
double buffer created via the wrap methods of this class will
be non-direct. A double buffer created as a view of a byte buffer will
be direct if, and only if, the byte buffer itself is direct. Whether or not
a double buffer is direct may be determined by invoking the isDirect method.
Methods in this class that do not otherwise have a value to return are specified to return the buffer upon which they are invoked. This allows method invocations to be chained.
| Modifier and Type | Method | Description |
|---|---|---|
static DoubleBuffer |
allocate(int capacity) |
Allocates a new double buffer.
|
double[] |
array() |
Returns the double array that backs this
buffer (optional operation).
|
int |
arrayOffset() |
Returns the offset within this buffer's backing array of the first
element of the buffer (optional operation).
|
abstract DoubleBuffer |
asReadOnlyBuffer() |
Creates a new, read-only double buffer that shares this buffer's
content.
|
abstract DoubleBuffer |
compact() |
Compacts this buffer (optional operation).
|
int |
compareTo(DoubleBuffer that) |
Compares this buffer to another.
|
abstract DoubleBuffer |
duplicate() |
Creates a new double buffer that shares this buffer's content.
|
boolean |
equals(Object ob) |
Tells whether or not this buffer is equal to another object.
|
abstract double |
get() |
Relative get method.
|
DoubleBuffer |
get(double[] dst) |
Relative bulk get method.
|
DoubleBuffer |
get(double[] dst,
int offset,
int length) |
Relative bulk get method.
|
abstract double |
get(int index) |
Absolute get method.
|
boolean |
hasArray() |
Tells whether or not this buffer is backed by an accessible double
array.
|
int |
hashCode() |
Returns the current hash code of this buffer.
|
abstract boolean |
isDirect() |
Tells whether or not this double buffer is direct.
|
abstract ByteOrder |
order() |
Retrieves this buffer's byte order.
|
abstract DoubleBuffer |
put(double d) |
Relative put method (optional operation).
|
DoubleBuffer |
put(double[] src) |
Relative bulk put method (optional operation).
|
DoubleBuffer |
put(double[] src,
int offset,
int length) |
Relative bulk put method (optional operation).
|
DoubleBuffer |
put(DoubleBuffer src) |
Relative bulk put method (optional operation).
|
abstract DoubleBuffer |
put(int index,
double d) |
Absolute put method (optional operation).
|
abstract DoubleBuffer |
slice() |
Creates a new double buffer whose content is a shared subsequence of
this buffer's content.
|
String |
toString() |
Returns a string summarizing the state of this buffer.
|
static DoubleBuffer |
wrap(double[] array) |
Wraps a double array into a buffer.
|
static DoubleBuffer |
wrap(double[] array,
int offset,
int length) |
Wraps a double array into a buffer.
|