Bridges-Java  3.4.2
Bridges(Java API)
Public Member Functions | Protected Member Functions | List of all members
bridges.base.Array< E > Class Template Reference
Inheritance diagram for bridges.base.Array< E >:
bridges.base.DataStruct bridges.base.Array1D< E > bridges.base.Array2D< E > bridges.base.Array3D< E >

Detailed Description

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.

This class is not directly called; instead use subclasses of arrays to construct arrays, depending on their dimension.

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
https://bridgesuncc.github.io/tutorials/Array.html (1D, 2D, and 3D Array)

Public Member Functions

 Array ()
 
 Array (int num_dims, int[] dims)
 
String getDataStructType ()
 
void setNumDimensions (int nd)
 
int getNumDimensions ()
 
void setSize (int nd, int[] dim)
 Set the size of each dimensions; also allocates array space. More...
 
void getDimensions (int[] dim)
 Get the size of each dimensions;. More...
 
int getSize ()
 
String getDataStructureRepresentation ()
 

Protected Member Functions

Element< E > getElement (int indx)
 
void setElement (int indx, Element< E > el)
 

Additional Inherited Members

- Protected Attributes inherited from bridges.base.DataStruct
String QUOTE = "\""
 
- Package Attributes inherited from bridges.base.DataStruct
String COMMA = ","
 
String COLON = ":"
 
String OPEN_CURLY = "{"
 
String CLOSE_CURLY = "}"
 
String OPEN_PAREN = "("
 
String CLOSE_PAREN = ")"
 
String OPEN_BOX = "["
 
String CLOSE_BOX = "]"
 

Constructor & Destructor Documentation

◆ Array() [1/2]

◆ Array() [2/2]

bridges.base.Array< E >.Array ( int  num_dims,
int[]  dims 
)

Create an array object with the specified dimensions

Parameters
num_dimsnumber of dimensions of the array
dimssize of each dimension

Member Function Documentation

◆ getDataStructType()

String bridges.base.Array< E >.getDataStructType ( )

This method gets the data structure type

Returns
The date structure type as a string

Reimplemented from bridges.base.DataStruct.

◆ getDataStructureRepresentation()

String bridges.base.Array< E >.getDataStructureRepresentation ( )

Gets the data structure representation of the array (as JSON)

Returns
array representation as a JSON

Reimplemented from bridges.base.DataStruct.

◆ getDimensions()

void bridges.base.Array< E >.getDimensions ( int[]  dim)

Get the size of each dimensions;.

Returns
dim[] size of each dimension is returned

◆ getElement()

Element<E> bridges.base.Array< E >.getElement ( int  indx)
protected

Get the object at 'indx'

Parameters
indxindex into the array
Returns
Element<E> object at 'indx'

Reimplemented in bridges.base.Array1D< E >.

◆ getNumDimensions()

int bridges.base.Array< E >.getNumDimensions ( )

Get the number of dimensions of the array;

Returns
number of dimensions

◆ getSize()

int bridges.base.Array< E >.getSize ( )

Get the array size

Returns
size of the array

◆ setElement()

void bridges.base.Array< E >.setElement ( int  indx,
Element< E >  el 
)
protected

Set the input object at 'indx' - for 1D array

Parameters
indxindex into the array
elelement object to be assigned at 'indx'

Reimplemented in bridges.base.Array1D< E >.

◆ setNumDimensions()

void bridges.base.Array< E >.setNumDimensions ( int  nd)

Set the number of dimensions of the array;

Parameters
ndnumber of dimensions

◆ setSize()

void bridges.base.Array< E >.setSize ( int  nd,
int[]  dim 
)

Set the size of each dimensions; also allocates array space.

Parameters
ndnumber of dimension
dimsize of each dimension

The documentation for this class was generated from the following file: