|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapred.BigIntegerWritable
public class BigIntegerWritable
Provides an immutable implementation of a big integer for use in Hadoop framework.
Similarly to the Java BigInteger
class, this class supports two basic mathematical operations: addition and multiplication.
Besides, it also implements the Writable
interface to support reading and writing operations in Hadoop framework.
Constructor Summary | |
---|---|
BigIntegerWritable()
Default constructor without initialization. |
|
BigIntegerWritable(java.math.BigInteger n)
Constructs a BigIntegerWritable object from a Java BigInteger object. |
|
BigIntegerWritable(java.io.DataInput in)
Constructs a BigIntegerWritable object from the input stream. |
|
BigIntegerWritable(int n)
Constructs a BigIntegerWritable object from an integer. |
Method Summary | |
---|---|
BigIntegerWritable |
add(BigIntegerWritable a)
Returns a new BigIntegerWritable object with value equal to the sum of this object's value and another object's value. |
int |
getSize()
Returns the total size in bytes representing the value of the object. |
BigIntegerWritable |
multiply(BigIntegerWritable a)
Returns a new BigIntegerWritable object with value equal to the product of this object's value and another object's value. |
void |
readFields(java.io.DataInput in)
Initializes the object by reading data from the input stream. |
java.lang.String |
toString()
Returns a string representing this object. |
void |
write(java.io.DataOutput out)
Writes the object into the specified output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BigIntegerWritable()
MapRed
-classes.
Therefore, one should manually initialize the value of this object after using this constructor.
public BigIntegerWritable(int n)
n
- initialized value for the constructed object.public BigIntegerWritable(java.math.BigInteger n)
n
- initialized value for the constructed object.public BigIntegerWritable(java.io.DataInput in) throws java.io.IOException
readFields(DataInput)
to read the value from the input stream.
in
- input stream
java.io.IOException
- if IO errors occur.for storing format of the object in the stream.
Method Detail |
---|
public void readFields(java.io.DataInput in) throws java.io.IOException
The object is stored in a stream as an ordered sequence of bytes:
readFields
in interface org.apache.hadoop.io.Writable
in
- input stream.
java.io.IOException
- if IO errors occur.public void write(java.io.DataOutput out) throws java.io.IOException
readFields(DataInput)
.
write
in interface org.apache.hadoop.io.Writable
out
- output stream.
java.io.IOException
- if IO errors occur.for storing format of the object in the stream.
public int getSize()
public BigIntegerWritable add(BigIntegerWritable a)
a
- another object.
public BigIntegerWritable multiply(BigIntegerWritable a)
a
- another object.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |