public class DoubleBuffer extends BaseDataBuffer
DataBuffer.Type
isPersist, length, MAPPING_SIZE, mappings, memoryMappedBuffer, path, ref, referencing
Constructor and Description |
---|
DoubleBuffer(double[] buffer) |
DoubleBuffer(double[] buffer,
boolean copy) |
DoubleBuffer(int length) |
Modifier and Type | Method and Description |
---|---|
byte[] |
asBytes()
Raw byte array storage
|
double[] |
asDouble()
Return the buffer as a double array
Relative to the datatype, this will either be a copy
or a reference.
|
float[] |
asFloat()
Return the buffer as a float array
Relative to the datatype, this will either be a copy
or a reference.
|
int[] |
asInt()
Return the buffer as an int array
Relative to the datatype, this will either be a copy
or a reference.
|
void |
assign(Number value,
int offset)
Assign the given value to the buffer
starting at offset
|
DataBuffer.Type |
dataType()
The data type of the buffer
|
void |
destroy()
release all resources for this buffer
|
DataBuffer |
dup()
Return a copy of this buffer
|
boolean |
equals(Object o) |
void |
flush()
Flush the data buffer
|
double |
getDouble(int i)
Get element i in the buffer as a double
|
int |
getElementSize()
The number of bytes for each individual element
|
float |
getFloat(int i)
Get element i in the buffer as a double
|
int |
getInt(int ix)
Get the int at the specified index
|
Number |
getNumber(int i)
Get element i in the buffer as a double
|
int |
hashCode() |
void |
put(int i,
double element)
Assign an element in the buffer to the specified index
|
void |
put(int i,
float element)
Assign an element in the buffer to the specified index
|
void |
put(int i,
int element)
Assign an element in the buffer to the specified index
|
void |
setData(double[] data)
Set the data for this buffer
|
void |
setData(float[] data)
Set the data for this buffer
|
void |
setData(int[] data)
Set the data for this buffer
|
addReferencing, assign, assign, assign, assign, assign, assign, assign, assign, assign, getComplex, getComplexDouble, getComplexFloat, getDoublesAt, getDoublesAt, getFloatsAt, getFloatsAt, isPersist, length, persist, put, references, removeReferencing, toByteArray, toByteArray, toByteArray, toDouble, toFloat, toInt
public DoubleBuffer(int length)
public DoubleBuffer(double[] buffer)
public DoubleBuffer(double[] buffer, boolean copy)
public void setData(int[] data)
DataBuffer
data
- the data for this bufferpublic void setData(float[] data)
DataBuffer
data
- the data for this bufferpublic void setData(double[] data)
DataBuffer
data
- the data for this bufferpublic byte[] asBytes()
DataBuffer
public DataBuffer.Type dataType()
DataBuffer
public float[] asFloat()
DataBuffer
public double[] asDouble()
DataBuffer
public int[] asInt()
DataBuffer
public double getDouble(int i)
DataBuffer
i
- the element to getFloatpublic void assign(Number value, int offset)
DataBuffer
value
- assign the value to setoffset
- the offset to start atpublic float getFloat(int i)
DataBuffer
i
- the element to getFloatpublic Number getNumber(int i)
DataBuffer
i
- the element to getFloatpublic void put(int i, float element)
DataBuffer
i
- the indexelement
- the element to assignpublic void put(int i, double element)
DataBuffer
i
- the indexelement
- the element to assignpublic void put(int i, int element)
DataBuffer
i
- the indexelement
- the element to assignpublic int getInt(int ix)
DataBuffer
ix
- the int at the specified indexpublic DataBuffer dup()
DataBuffer
public void flush()
DataBuffer
public int getElementSize()
DataBuffer
public void destroy()
DataBuffer
Copyright © 2015. All Rights Reserved.