public class DoubleArrayWritable extends Object implements org.apache.hadoop.io.Writable
| Constructor and Description |
|---|
DoubleArrayWritable() |
DoubleArrayWritable(double[] array)
Constructor with array as input.
|
DoubleArrayWritable(double[] array,
int length)
Constructor with array as input and with a specific size.
|
DoubleArrayWritable(int size)
Constructor that creates an empty array of a particular size.
|
| Modifier and Type | Method and Description |
|---|---|
double |
get(int i)
Returns the value at index i.
|
double[] |
getArray()
Returns a reference to the underlying array.
|
double[] |
getClone()
Returns a deep copy of the array.
|
void |
readFields(DataInput in) |
void |
set(int i,
double v)
Sets the value at index i.
|
void |
setArray(double[] array)
Sets the underlying array.
|
void |
setArray(double[] 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 DoubleArrayWritable()
public DoubleArrayWritable(double[] array)
array - input arraypublic DoubleArrayWritable(double[] array,
int length)
array - input arraylength - lengthpublic DoubleArrayWritable(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 double[] getClone()
size(). That is, trailing unused space in the underlying array will be trimmed.public double[] getArray()
size().public void setArray(double[] array)
public void setArray(double[] array,
int length)
public double get(int i)
i - index positionpublic void set(int i,
double v)
i - position in arrayv - valuepublic int size()
Copyright © 2018. All rights reserved.