com.jme3.scene.plugins.blender.file
Class DynamicArray<T>

java.lang.Object
  extended by com.jme3.scene.plugins.blender.file.DynamicArray<T>
Type Parameters:
T - the type of stored data in the array
All Implemented Interfaces:
java.lang.Cloneable

public class DynamicArray<T>
extends java.lang.Object
implements java.lang.Cloneable

An array that can be dynamically modified/


Constructor Summary
DynamicArray(int[] tableSizes)
          Constructor.
DynamicArray(int[] tableSizes, T[] data)
          Constructor.
 
Method Summary
 java.lang.Object clone()
           
 T get(int... position)
          This method returns a value on the specified position in multidimensional array.
 T get(int position)
          This method returns a value on the specified position.
 int getTotalSize()
          This method returns the total amount of data stored in the array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DynamicArray

public DynamicArray(int[] tableSizes)
             throws BlenderFileException
Constructor. Builds an empty array of the specified sizes.

Parameters:
tableSizes - the sizes of the table
Throws:
BlenderFileException - an exception is thrown if one of the sizes is not a positive number

DynamicArray

public DynamicArray(int[] tableSizes,
                    T[] data)
             throws BlenderFileException
Constructor. Builds an empty array of the specified sizes.

Parameters:
tableSizes - the sizes of the table
Throws:
BlenderFileException - an exception is thrown if one of the sizes is not a positive number
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

get

public T get(int position)
This method returns a value on the specified position. The dimension of the table is not taken into consideration.

Parameters:
position - the position of the data
Returns:
required data

get

public T get(int... position)
This method returns a value on the specified position in multidimensional array. Be careful not to exceed the table boundaries. Check the table's dimension first.

Parameters:
position - the position of the data indices of data position
Returns:
required data required data

getTotalSize

public int getTotalSize()
This method returns the total amount of data stored in the array.

Returns:
the total amount of data stored in the array

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object