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