Provides an immutable implementation of a big integer for use in Hadoop framework. More...
Inherits Writable.
Public Member Functions | |
BigIntegerWritable () | |
Default constructor without initialization. | |
BigIntegerWritable (int n) | |
Constructs a BigIntegerWritable object from an integer. | |
BigIntegerWritable (BigInteger n) | |
Constructs a BigIntegerWritable object from a Java BigInteger object. | |
BigIntegerWritable (DataInput in) throws IOException | |
Constructs a BigIntegerWritable object from the input stream. | |
void | readFields (DataInput in) throws IOException |
Initializes the object by reading data from the input stream. | |
void | write (DataOutput out) throws IOException |
Writes the object into the specified output stream. | |
int | getSize () |
Returns the total size in bytes representing the value of the object. | |
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. | |
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. | |
String | toString () |
Returns a string representing this object. |
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.
mapred.BigIntegerWritable.BigIntegerWritable | ( | ) | [inline] |
Default constructor without initialization.
This constructor is needed for the iterator used in the reduce method of MapRed
-classes. Therefore, one should manually initialize the value of this object after using this constructor.
mapred.BigIntegerWritable.BigIntegerWritable | ( | int | n | ) | [inline] |
Constructs a BigIntegerWritable object from an integer.
n | initialized value for the constructed object. |
mapred.BigIntegerWritable.BigIntegerWritable | ( | BigInteger | n | ) | [inline] |
Constructs a BigIntegerWritable object from a Java BigInteger object.
n | initialized value for the constructed object. |
mapred.BigIntegerWritable.BigIntegerWritable | ( | DataInput | in | ) | throws IOException [inline] |
Constructs a BigIntegerWritable object from the input stream.
This constructor is a short-hand for initializing the object with the default constructor and calling readFields(DataInput) to read the value from the input stream.
in | input stream |
IOException | if IO errors occur. |
Returns a new BigIntegerWritable object with value equal to the sum of this object's value and another object's value.
a | another object. |
int mapred.BigIntegerWritable.getSize | ( | ) | [inline] |
Returns the total size in bytes representing the value of the object.
Returns a new BigIntegerWritable object with value equal to the product of this object's value and another object's value.
a | another object. |
void mapred.BigIntegerWritable.readFields | ( | DataInput | in | ) | throws IOException [inline] |
Initializes the object by reading data from the input stream.
The object is stored in a stream as an ordered sequence of bytes:
in | input stream. |
IOException | if IO errors occur. |
void mapred.BigIntegerWritable.write | ( | DataOutput | out | ) | throws IOException [inline] |
Writes the object into the specified output stream.
The sequence of bytes representing the object is in the format described in readFields(DataInput).
out | output stream. |
IOException | if IO errors occur. |