public class FloatArrayWritable extends Object implements org.apache.hadoop.io.Writable
| Constructor and Description |
|---|
FloatArrayWritable() |
FloatArrayWritable(float[] array)
Constructor with array as input.
|
FloatArrayWritable(float[] array,
int length)
Constructor with array as input and with a specific size.
|
FloatArrayWritable(int size)
Constructor that creates an empty array of a particular size.
|
| Modifier and Type | Method and Description |
|---|---|
float |
get(int i)
Returns the value at index i.
|
float[] |
getArray()
Returns a reference to the underlying array.
|
float[] |
getClone()
Returns a deep copy of the array.
|
void |
readFields(DataInput in) |
void |
set(int i,
float v)
Sets the value at index i.
|
void |
setArray(float[] array)
Sets the underlying array.
|
void |
setArray(float[] array,
int length)
Sets the underlying array and a specified length.
|
int |
size()
Returns the size of the float array.
|
String |
toString() |
void |
write(DataOutput out) |
public FloatArrayWritable()
public FloatArrayWritable(float[] array)
array - input arraypublic FloatArrayWritable(float[] array,
int length)
array - input arraylength - lengthpublic FloatArrayWritable(int size)
size - array sizepublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic float[] getClone()
size(). That is, trailing unused space in the underlying array will be trimmed.public float[] getArray()
size().public void setArray(float[] array)
public void setArray(float[] array,
int length)
public float get(int i)
i - index positionpublic void set(int i,
float v)
i - position in arrayv - valuepublic int size()
Copyright © 2014. All rights reserved.