de.jreality.scene.data
Class DataList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
de.jreality.scene.data.DataItem
de.jreality.scene.data.DataList
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List
- Direct Known Subclasses:
- ByteBufferList, DoubleArray, DoubleArrayArray, IntArray, IntArrayArray, StringArray, StringArrayArray, WritableDataList
public class DataList
- extends DataItem
- implements java.io.Serializable
A data list using a storage model
for the data.
This list is readonly. There are several methods allowing to open
another view to the same list using a different storage model or using
an explicitly declared storage model for higher performance.
These methods might return the same instance using a more specific declared
type if the storage model matches that type. They might convert the data
into a different but compatible storage model. And they throw a
java.util.UnsupportedOperationException
for incompatible models.
The subclasses with explicit storage models can be used to create
effectively immutable arrays. The point about these wrapped arrays is that a
good JIT compiler optimizes access to these to be not slower than for direct
array access but writing is still reserved to the creator.
- Author:
- Holger
- See Also:
List
,
StorageModel
,
#Item
,
Serialized Form
Methods inherited from class de.jreality.scene.data.DataItem |
copyTo, copyTo, printUsage, toDoubleArray, toDoubleArrayArray, toIntArray, 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 |
getStorageModel
public StorageModel getStorageModel()
- Specified by:
getStorageModel
in class DataItem
get
public java.lang.Object get(int index)
- Specified by:
get
in interface java.util.List
- Specified by:
get
in class java.util.AbstractList
item
public DataItem item(int index)
size
public int size()
- Specified by:
size
in interface java.util.Collection
- Specified by:
size
in interface java.util.List
- Specified by:
size
in class java.util.AbstractCollection
toIntArray
public IntArray toIntArray()
- Overrides:
toIntArray
in class DataItem
toIntArrayArray
public IntArrayArray toIntArrayArray()
- Overrides:
toIntArrayArray
in class DataItem
toDoubleArray
public DoubleArray toDoubleArray()
- Overrides:
toDoubleArray
in class DataItem
toDoubleArrayArray
public DoubleArrayArray toDoubleArrayArray()
readOnlyList
public DataList readOnlyList()
- Return a read only view to this list. This will return
this
for DataList classes that do not provide any method with modifying side
effects. Writeable instances will create a read only view using the same
underlying data reference thus changes to the writable list will propagate
immediately to these views. The views might be cached and reused.
- Returns:
toString
public java.lang.String toString()
- Overrides:
toString
in class java.util.AbstractCollection