This class can be used to create arrays of type Element<E>.
More...
|
| Array () |
|
| Array (int num_dims, int[] dims) |
|
| Array (int num_elements) |
|
| Array (int x_dim, int y_dim) |
|
| Array (int x_dim, int y_dim, int z_dim) |
|
String | getDataStructType () |
|
void | setNumDimensions (int nd) |
|
int | getNumDimensions () |
|
void | setDimensions (int[] dim) |
|
void | getDimensions (int[] dim) |
|
int | getSize () |
|
Element< E > | getElement (int indx) |
|
Element< E > | getElement (int x, int y) |
|
Element< E > | getElement (int x, int y, int z) |
|
void | setElement (int indx, Element< E > el) |
|
void | setElement (int x, int y, Element< E > el) |
|
void | setElement (int x, int y, int z, Element< E > el) |
|
String | getDataStructureRepresentation () |
|
abstract String | getDataStructType () |
|
This class can be used to create arrays of type Element<E>.
- Author
- Kalpathi Subramanian
- Date
- 10/8/16, 5/17/17, 5/30/18
This class can be used to create arrays of type Element<E> where E is a generic object representing application specific data.
Arrays are internally represented as 1D arrays; currently 1D, 2D and 3D arrays are supported.
- Parameters
-
<E> | The generic parameter object that is part of this element, representing application specific data. |
- See also
- Example Tutorial at
http://bridgesuncc.github.io/Hello_World_Tutorials/ARRAY1D.html (1D Array)
http://bridgesuncc.github.io/Hello_World_Tutorials/ARRAY2D.html (2D Array)
http://bridgesuncc.github.io/Hello_World_Tutorials/ARRAY3D.html (3D Array)
Create an array object with the specified dimensions
- Parameters
-
num_dims | number of dimensions of the array |
dims | size of each dimension |
Create an 1D array object
- Parameters
-
Create an 2D array object
- Parameters
-
x_dim | number of elements along dimension 1 |
y_dim | number of elements along dimension 1 |
Create an 3D array object
- Parameters
-
x_dim | number of elements along dimension 1 |
y_dim | number of elements along dimension 1 |
z_dim | number of elements along dimension 1 |
This method gets the data structure type
- Returns
- The date structure type as a string
Generating the JSON string for a Bridges array object (Array<E>[])
- Parameters
-
- Returns
- JSON string
Get the size of each dimensions;
- Parameters
-
dims[] | size of each dimension is returned |
Get the object at 'indx'
- Parameters
-
- Returns
- Element<E> object at 'indx'
Get the object at index x, y – for 2D arrays
- Parameters
-
x | - column index |
y | - row index |
- Returns
- Element<E> object at x, y
Get the object at x, y, z – for 3D arrays
- Parameters
-
x | - column index |
y | - row index |
z | - slice index |
- Returns
- Element<E> object at x, y, z
Get the number of dimensions of the array;
- Returns
- number of dimensions
Get the array size
- Returns
- size
Set the size of each dimensions; also allocates array space
- Parameters
-
dim[] | size of each dimension |
Set the input object at 'indx' - for 1D array
- Parameters
-
indx | index into the array |
el | element object to be assigned at 'indx' |
Set the input object at x, y - 2D arrays
- Parameters
-
x | column index into the array |
y | row index into the array |
el | element object to be assigned at 'indx' |
Set the input object at 'col, row, slice'
- Parameters
-
x | column index into the array |
y | row index into the array |
z | slice index into the array |
el | element object to be assigned at 'indx' |
Set the number of dimensions of the array;
- Parameters
-
The documentation for this class was generated from the following file:
- /Users/kalpathi/gr/bridges/bridges17/java/src/main/java/bridges/base/Array.java