Int2D

Inheritance: java.lang.Object

public final class Int2D

Created by lexchou on 5/17/2017. 2-dimensional int array wrapper

Constructors

ConstructorDescription
Int2D(int rows, int columns)Construct a 2D int array with default data allocation.
Int2D(int rows, int columns, int[] data)Construct a 2D int array with given data

Methods

MethodDescription
equals(Object arg0)
get(int r, int c)Gets the element at specified position
getClass()
getColumns()
getLength(int rank)
getRows()
hashCode()
length()Gets the total length of this 2d array
notify()
notifyAll()
set(int r, int c, int v)Sets the element at specified position
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

Int2D(int rows, int columns)

public Int2D(int rows, int columns)

Construct a 2D int array with default data allocation.

Parameters:

ParameterTypeDescription
rowsintNumber of rows of the 2D array
columnsintNumber of columns of the 2D array

Int2D(int rows, int columns, int[] data)

public Int2D(int rows, int columns, int[] data)

Construct a 2D int array with given data

Parameters:

ParameterTypeDescription
rowsintNumber of rows of the 2D array
columnsintNumber of columns of the 2D array
dataint[]Array to wrap, Float2D will use this array internally.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

get(int r, int c)

public int get(int r, int c)

Gets the element at specified position

Parameters:

ParameterTypeDescription
rintRow
cintColumn

Returns: int - the value at specified position

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColumns()

public int getColumns()

Returns: int

getLength(int rank)

public int getLength(int rank)

Parameters:

ParameterTypeDescription
rankint

Returns: int

getRows()

public int getRows()

Returns: int

hashCode()

public native int hashCode()

Returns: int

length()

public int length()

Gets the total length of this 2d array

Returns: int - the total number of floats in this 2d array.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

set(int r, int c, int v)

public void set(int r, int c, int v)

Sets the element at specified position

Parameters:

ParameterTypeDescription
rintRow
cintColumn
vintValue

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int