edu.umd.cloud9.io.array
Class Array2DOfDoublesWritable

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

public class Array2DOfDoublesWritable
extends Object
implements Writable


Constructor Summary
Array2DOfDoublesWritable()
          Default constructor.
Array2DOfDoublesWritable(double[][] array)
          Constructor take in a two-dimensional array.
Array2DOfDoublesWritable(int row, int column)
          Constructor that takes the size of the array as an argument.
 
Method Summary
 double[][] getArray()
           
 double[][] getClone()
           
 int getNumberOfCols()
          Returns the number of columns in the array.
 int getNumberOfRows()
          Returns the number of rows in the float array.
 double getValueAt(int row, int col)
          Returns the double value at position i.
 void readFields(DataInput in)
           
 void set(double[][] array)
          Constructor take in a two-dimensional array.
 void setValueAt(int row, int col, double f)
          Sets the double 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

Array2DOfDoublesWritable

public Array2DOfDoublesWritable()
Default constructor.


Array2DOfDoublesWritable

public Array2DOfDoublesWritable(double[][] 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 double array

Array2DOfDoublesWritable

public Array2DOfDoublesWritable(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 double[][] getClone()

getArray

public double[][] getArray()

getValueAt

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

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

set

public void set(double[][] 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 double array

setValueAt

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

Parameters:
f - double 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