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

Detailed Description

This is a class can be used to create 1 dimensional arrays of type Element<E>.

Author
Kalpathi Subramanian
Date
7/18/19

This class can be used to create 1D arrays of type Element<E> where E is a generic object representing application specific data.

Array1D has iterator semantic to enable range for loops. For instance,

Array1D<Integer> arr = something();
for (Integer i : arr)
System.out.println(i);
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

 Array1D ()
 
 Array1D (int sz)
 
Element< E > getElement (int indx)
 
void setElement (int indx, Element< E > el)
 
Iterator< E > iterator ()
 
- Public Member Functions inherited from bridges.base.Array< E >
 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 ()
 

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

◆ Array1D() [1/2]

◆ Array1D() [2/2]

bridges.base.Array1D< E >.Array1D ( int  sz)

Create a 1D array object

Parameters
sznumber of elements in the array

Member Function Documentation

◆ getElement()

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

Get the object at 'indx'

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

Reimplemented from bridges.base.Array< E >.

◆ iterator()

Iterator<E> bridges.base.Array1D< E >.iterator ( )

◆ setElement()

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

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

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

Reimplemented from bridges.base.Array< E >.


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