de.jreality.scene.data
Class IntArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by de.jreality.scene.data.DataItem
              extended by de.jreality.scene.data.DataList
                  extended by de.jreality.scene.data.IntArray
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.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)
           
 
Method Summary
 int getLength()
           
 int getValueAt(int n)
           
 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.
 IntArray toIntArray()
           
 int[] toIntArray(int[] target)
          Copy the data into the specified array or into a new one if the target parameter is null.
 java.nio.ByteBuffer toNativeByteBuffer(java.nio.ByteBuffer bb)
          copies the containing data into a given or native ByteBuffer
JUST FOR TESTING
 
Methods inherited from class de.jreality.scene.data.DataList
get, getStorageModel, item, readOnlyList, size, toDoubleArray, toDoubleArrayArray, toIntArrayArray, toString
 
Methods inherited from class de.jreality.scene.data.DataItem
copyTo, copyTo, printUsage, toDoubleArrayArray, toIntArrayArray, toStringArray, toStringArray, toStringArrayArray, toStringArrayArray
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

IntArray

public IntArray(int[] data)

IntArray

public IntArray(int[] data,
                int offset,
                int length)
Method Detail

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 java.nio.ByteBuffer toNativeByteBuffer(java.nio.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()