edu.umd.cloud9.io.array
Class ArrayOfFloatsWritable

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

public class ArrayOfFloatsWritable
extends Object
implements Writable

An array of floats that implements Writable class.

Author:
ferhanture

Constructor Summary
ArrayOfFloatsWritable()
          Constructor with no arguments.
ArrayOfFloatsWritable(int size)
          Constructor that takes the size of the array as an argument.
 
Method Summary
 float get(int i)
          Returns the float value at position i.
 void readFields(DataInput in)
           
 void set(int i, float f)
          Sets the float at position i to f.
 int size()
          Returns the size of the float array.
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayOfFloatsWritable

public ArrayOfFloatsWritable()
Constructor with no arguments.


ArrayOfFloatsWritable

public ArrayOfFloatsWritable(int size)
Constructor that takes the size of the array as an argument.

Parameters:
size - number of floats in array
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

get

public float get(int i)
Returns the float value at position i.

Parameters:
i - index of float to be returned
Returns:
float value at position i

set

public void set(int i,
                float f)
Sets the float at position i to f.

Parameters:
i - position in array
f - float value to be set

size

public int size()
Returns the size of the float array.

Returns:
size of array

toString

public String toString()
Overrides:
toString in class Object