edu.umd.cloud9.io.array
Class Array2DOfFloatsWritable

java.lang.Object
  extended by edu.umd.cloud9.io.array.Array2DOfFloatsWritable
All Implemented Interfaces:
Writable

public class Array2DOfFloatsWritable
extends Object
implements Writable


Constructor Summary
Array2DOfFloatsWritable()
          Default constructor.
Array2DOfFloatsWritable(float[][] array)
          Constructor take in a two-dimensional array.
Array2DOfFloatsWritable(int row, int column)
          Constructor that takes the size of the array as an argument.
 
Method Summary
 float[][] getArray()
           
 float[][] getClone()
           
 int getNumberOfCols()
          Returns the number of columns in the array.
 int getNumberOfRows()
          Returns the number of rows in the float array.
 float getValueAt(int row, int col)
          Returns the float value at position i.
 void readFields(DataInput in)
           
 void set(float[][] array)
          Constructor take in a two-dimensional array.
 void setValueAt(int row, int col, float f)
          Sets the float at position row and col to f.
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Array2DOfFloatsWritable

public Array2DOfFloatsWritable()
Default constructor.


Array2DOfFloatsWritable

public Array2DOfFloatsWritable(float[][] array)
Constructor take in a two-dimensional array. Take note for consistent purpose, the constructor would re-format the array to a well shaped 2-dimensional array.

Parameters:
array - input float array

Array2DOfFloatsWritable

public Array2DOfFloatsWritable(int row,
                               int column)
Constructor that takes the size of the array as an argument.

Method Detail

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface Writable
Throws:
IOException

getClone

public float[][] getClone()

getArray

public float[][] getArray()

getValueAt

public float getValueAt(int row,
                        int col)
Returns the float value at position i.

Parameters:
row - row index of the float to be returned
col - column index of the float to be returned
Returns:
float value at position row and col<\i>

set

public void set(float[][] array)
Constructor take in a two-dimensional array. Take note for consistent purpose, the constructor would re-format the array to a well shaped 2-dimensional array.

Parameters:
array - input float array

setValueAt

public void setValueAt(int row,
                       int col,
                       float f)
Sets the float at position row and col to f.

Parameters:
f - float value to be set

getNumberOfRows

public int getNumberOfRows()
Returns the number of rows in the float array.

Returns:
number of rows in array

getNumberOfCols

public int getNumberOfCols()
Returns the number of columns in the array.

Returns:
number of columns in the array

toString

public String toString()
Overrides:
toString in class Object