T - the type of object (i.e. Vector3f)public abstract class CompactArray<T> extends java.lang.Object implements JmeCloneable
| Modifier and Type | Field and Description | 
|---|---|
protected float[] | 
array  | 
protected int[] | 
index  | 
protected java.util.Map<T,java.lang.Integer> | 
indexPool  | 
| Constructor and Description | 
|---|
CompactArray()
Creates a compact array 
 | 
CompactArray(float[] compressedArray,
            int[] index)
create array using serialized data 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
add(T... objArray)
Add objects. 
 | 
CompactArray | 
clone()
Create a deep clone of this array. 
 | 
void | 
cloneFields(Cloner cloner,
           java.lang.Object original)
Callback from  
Cloner to convert this
 shallow-cloned array into a deep-cloned one, using the specified cloner
 to resolve copied fields. | 
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)
Return 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 
 | 
java.lang.Object | 
jmeClone()
Create a shallow clone for the JME cloner. 
 | 
void | 
serialize()
serialize this compact array 
 | 
protected abstract void | 
serialize(int compactIndex,
         T store)
serialize object 
 | 
void | 
set(int index,
   T value)  | 
protected void | 
setInvalid(boolean invalid)  | 
T[] | 
toObjectArray()
decompress and return object array 
 | 
protected java.util.Map<T,java.lang.Integer> indexPool
protected int[] index
protected float[] array
public CompactArray()
public CompactArray(float[] compressedArray,
                    int[] index)
compressedArray - storage for float dataindex - storage for indicespublic void add(T... objArray)
objArray - the objects to be added (may be null)public void freeze()
protected void setInvalid(boolean invalid)
public final void set(int index,
                      T value)
index - zero-origin index of the element to be alteredvalue - the desired valuepublic final T get(int index, T store)
index - the indexstore - an object to store the resultpublic final float[] getSerializedData()
public final void serialize()
protected final int getSerializedSize()
protected float[] ensureCapacity(float[] arr,
                                 int size)
arr - the arraysize - the sizepublic final int[] getIndex(T... objArray)
objArray - the input objectspublic int getCompactIndex(int objIndex)
objIndex - the input indexpublic final int getTotalObjectSize()
public final int getCompactObjectSize()
public final T[] toObjectArray()
public CompactArray clone() throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - neverpublic java.lang.Object jmeClone()
jmeClone in interface JmeCloneablepublic void cloneFields(Cloner cloner, java.lang.Object original)
Cloner to convert this
 shallow-cloned array into a deep-cloned one, using the specified cloner
 to resolve copied fields.cloneFields in interface JmeCloneablecloner - the cloner currently cloning this control (not null)original - the array from which this array was shallow-cloned
 (unused)protected abstract void serialize(int compactIndex,
                                  T store)
compactIndex - compacted object indexstore - the value to be serialized (not null, unaffected)protected abstract T deserialize(int compactIndex, T store)
compactIndex - compacted object indexstore - storage for the resultprotected abstract int getTupleSize()
protected abstract java.lang.Class<T> getElementClass()