|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cloud9.util.array.ArrayListOfInts
edu.umd.cloud9.io.array.ArrayListOfIntsWritable
public class ArrayListOfIntsWritable
Writable extension of the ArrayListOfInts class. This class allows the user to have an efficient data structure to store a list of integers in MapReduce tasks. It is especially useful for storing index lists, as it has an efficient intersection method.
| Constructor Summary | |
|---|---|
ArrayListOfIntsWritable()
Constructs an ArrayListOfIntsWritable object. |
|
ArrayListOfIntsWritable(ArrayListOfIntsWritable other)
Constructs a deep copy of the ArrayListOfIntsWritable object given as parameter. |
|
ArrayListOfIntsWritable(int initialCapacity)
Constructs an empty list with the specified initial capacity. |
|
ArrayListOfIntsWritable(int[] perm)
|
|
ArrayListOfIntsWritable(int firstNumber,
int lastNumber)
Constructs an ArrayListOfIntsWritable object from a given integer range [ first , last ). |
|
| Method Summary | |
|---|---|
void |
addAll(int[] arr)
Add all ints in the specified array into this object. |
ArrayListOfIntsWritable |
intersection(ArrayListOfIntsWritable other)
Computes the intersection of two sorted lists of this type. |
void |
readFields(DataInput in)
Deserializes this object. |
ArrayListOfIntsWritable |
sub(int start,
int end)
|
String |
toString()
Generates human-readable String representation of this ArrayList. |
void |
write(DataOutput out)
Serializes this object. |
| Methods inherited from class edu.umd.cloud9.util.array.ArrayListOfInts |
|---|
add, add, clear, clone, contains, ensureCapacity, get, getArray, indexOf, isEmpty, iterator, lastIndexOf, remove, set, setSize, shiftLastNToTop, size, toString, trimToSize |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayListOfIntsWritable()
public ArrayListOfIntsWritable(int firstNumber,
int lastNumber)
firstNumber - the smallest integer in the rangelastNumber - the largest integer in the rangepublic ArrayListOfIntsWritable(int initialCapacity)
initialCapacity - the initial capacity of the listpublic ArrayListOfIntsWritable(ArrayListOfIntsWritable other)
other - object to be copiedpublic ArrayListOfIntsWritable(int[] perm)
| Method Detail |
|---|
public void readFields(DataInput in)
throws IOException
readFields in interface Writablein - source for raw byte representation
IOException
public void write(DataOutput out)
throws IOException
write in interface Writableout - where to write the raw byte representation
IOExceptionpublic String toString()
toString in class ArrayListOfIntspublic ArrayListOfIntsWritable intersection(ArrayListOfIntsWritable other)
other.
other - other ArrayListOfIntsWritable that is intersected with this object
other and this object
public ArrayListOfIntsWritable sub(int start,
int end)
start - first index to be included in sub-listend - last index to be included in sub-list
start to endpublic void addAll(int[] arr)
arr - array of ints to add to this object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||