de.jreality.scene.data
Class IntArray
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
de.jreality.scene.data.DataItem
de.jreality.scene.data.DataList
de.jreality.scene.data.IntArray
- All Implemented Interfaces:
- Serializable, Iterable, Collection, List
public class IntArray
- extends DataList
An immutable array. A good JIT compiler optimizes this such that access it is not slower
as for the pure array. The advantage is, that only the creator who provided the array is allowed to
change it.
- Version:
- 1.0
- Author:
- Tim Hoffmann
- See Also:
- Serialized Form
Constructor Summary |
IntArray(int[] data)
|
IntArray(int[] data,
int offset,
int length)
|
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList |
IntArray
public IntArray(int[] data)
IntArray
public IntArray(int[] data,
int offset,
int length)
toIntArray
public IntArray toIntArray()
- Overrides:
toIntArray
in class DataList
toIntArray
public final int[] toIntArray(int[] target)
- Description copied from class:
DataItem
- Copy the data into the specified array or into a new one
if the target parameter is
null
. Returns
the filled array.
- Overrides:
toIntArray
in class DataItem
toNativeByteBuffer
public final ByteBuffer toNativeByteBuffer(ByteBuffer bb)
- copies the containing data into a given or native ByteBuffer
JUST FOR TESTING
- Parameters:
bb
-
- Returns:
- bb
toDoubleArray
public final double[] toDoubleArray(double[] target)
- Copies all entries of the underlying array into the
target
parameter or into a new array using widening conversion for each entry.
Return the target array.
- Overrides:
toDoubleArray
in class DataItem
getValueAt
public final int getValueAt(int n)
getLength
public final int getLength()