|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.Size
The Size class represents the extension of an object. The
Size class is not restricted to have a fixed amount of
components such that a Size can have any number of dimensions.
The Size class stores the components of the extend it represents
in an integer array. In order to work with the Size class in an
performant manner this array has public visibility. It is strongly
recommended to be aware of what you are doing with this array, because you
have full excess and do everything with it. This implies that you can harm
it! The indices of the single extensions within this array are defined
through X_EXTENSION, Y_EXTENSION and Z_EXTENSION
for 2D space and 3D space.
Notice that it is really necessary to work as fast as fast can be with the
Size class repectively with its single extensions. To get fast
access to the single extensions it is recommended to declared a local
variable as explained below. This also increases the guarantee that the
extensions array will not be harmed!
Size size = anObject.getSize(); final int[] extensions = size.extensions; extensions[Size.X_EXTENSION] = 100; extensions[Size.Y_EXTENSION] = 100;
| Field Summary | |
int[] |
extensions
instance variable for the single components of the size |
static int |
X_EXTENSION
constant that tells about the indices of the size's components |
static int |
Y_EXTENSION
constant that tells about the indices of the size's components |
static int |
Z_EXTENSION
constant that tells about the indices of the size's components |
| Constructor Summary | |
Size()
Default constructor for Size that initializes it for
2D space. |
|
Size(int[] extensions)
Constructor for Size with array of extensions given
extensions for a non fixed number of dimensions. |
|
Size(int dx,
int dy)
Constructor for Size with given extensions for the
x axis and the y axis. |
|
Size(int dx,
int dy,
int dz)
Constructor for Size with given extensions for the
x axis, y axis and the z axis. |
|
Size(Size size)
Copy constructor for Size. |
|
| Method Summary | |
int |
getDimensions()
Returns the number of dimensions this Size consist of. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int X_EXTENSION
public static final int Y_EXTENSION
public static final int Z_EXTENSION
public int[] extensions
| Constructor Detail |
public Size()
Size that initializes it for
2D space.
public Size(int dx,
int dy)
Size with given extensions for the
x axis and the y axis.
dx - the extension on the x axisdy - the extension on the y axis
public Size(int dx,
int dy,
int dz)
Size with given extensions for the
x axis, y axis and the z axis.
dx - the extension on the x axisdy - the extension on the y axisdz - the extension on the z axispublic Size(int[] extensions)
Size with array of extensions given
extensions for a non fixed number of dimensions.
extensions - the extensions on the different axespublic Size(Size size)
Size.
size - the Size instance to create a copy of| Method Detail |
public int getDimensions()
Size consist of.
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||