|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.animation.CompactArray<T>
T
- public abstract class CompactArray<T>
Object is indexed and stored in primitive float[]
Field Summary | |
---|---|
protected float[] |
array
|
protected int[] |
index
|
Constructor Summary | |
---|---|
CompactArray()
Creates a compact array |
|
CompactArray(float[] compressedArray,
int[] index)
create array using serialized data |
Method Summary | |
---|---|
void |
add(T... objArray)
Add objects. |
protected abstract T |
deserialize(int compactIndex,
T store)
deserialize object |
protected float[] |
ensureCapacity(float[] arr,
int size)
Ensure the capacity for the given array and the given size |
void |
freeze()
release objects. |
T |
get(int index,
T store)
returns the object for the given index |
int |
getCompactIndex(int objIndex)
returns the corresponding index in the compact array |
int |
getCompactObjectSize()
|
protected abstract java.lang.Class<T> |
getElementClass()
|
int[] |
getIndex(T... objArray)
retrun an array of indices for the given objects |
float[] |
getSerializedData()
return a float array of serialized data |
protected int |
getSerializedSize()
|
int |
getTotalObjectSize()
|
protected abstract int |
getTupleSize()
serialized size of one object element |
void |
serialize()
serialize this compact array |
protected abstract void |
serialize(int compactIndex,
T store)
serialize object |
void |
set(int index,
T value)
|
T[] |
toObjectArray()
decompress and return object array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] index
protected float[] array
Constructor Detail |
---|
public CompactArray()
public CompactArray(float[] compressedArray, int[] index)
compressedArray
- index
- Method Detail |
---|
public void add(T... objArray)
objArray
- public void freeze()
public final void set(int index, T value)
index
- value
- public final T get(int index, T store)
index
- the indexstore
- an object to store the result
public final float[] getSerializedData()
public final void serialize()
protected final int getSerializedSize()
protected float[] ensureCapacity(float[] arr, int size)
arr
- the arraysize
- the size
public final int[] getIndex(T... objArray)
objArray
-
public int getCompactIndex(int objIndex)
objIndex
-
public final int getTotalObjectSize()
public final int getCompactObjectSize()
public final T[] toObjectArray()
protected abstract void serialize(int compactIndex, T store)
compactIndex
- compacted object indexstore
- protected abstract T deserialize(int compactIndex, T store)
compactIndex
- compacted object indexstore
- protected abstract int getTupleSize()
protected abstract java.lang.Class<T> getElementClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |