com.intel.hadoop.graphbuilder.preprocess.mapreduce.keyvalue
Class PairListType<T1 extends org.apache.hadoop.io.Writable,T2 extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by com.intel.hadoop.graphbuilder.preprocess.mapreduce.keyvalue.PairListType<T1,T2>
Type Parameters:
T1 -
T2 -
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Direct Known Subclasses:
EdgeTransformJobTest.Value

public abstract class PairListType<T1 extends org.apache.hadoop.io.Writable,T2 extends org.apache.hadoop.io.Writable>
extends java.lang.Object
implements org.apache.hadoop.io.Writable

A general abstract class represents a list of pairs. Used as the intermediate map output value type in EdgeTransformMR for holding a list of VidType, EdgeData pairs.


Constructor Summary
PairListType()
          Creates an empty value.
 
Method Summary
 void add(T1 e1, T2 e2)
          Add a pair into the list.
 void append(PairListType<T1,T2> other)
          Append the other list to the end.
abstract  T1 createLValue()
           
abstract  T2 createRValue()
           
 void init(T1 e1, T2 e2)
          Initialize the list with a pair.
 java.util.Iterator<Pair<T1,T2>> iterator()
           
 java.util.List<T1> llist()
           
 void readFields(java.io.DataInput in)
           
 java.util.List<T2> rlist()
           
 int size()
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairListType

public PairListType()
Creates an empty value.

Method Detail

createLValue

public abstract T1 createLValue()

createRValue

public abstract T2 createRValue()

size

public int size()
Returns:
number of pairs in the list.

add

public void add(T1 e1,
                T2 e2)
Add a pair into the list.

Parameters:
e1 -
e2 -

init

public void init(T1 e1,
                 T2 e2)
Initialize the list with a pair.

Parameters:
e1 -
e2 -

llist

public java.util.List<T1> llist()

rlist

public java.util.List<T2> rlist()

append

public void append(PairListType<T1,T2> other)
Append the other list to the end.

Parameters:
other -

iterator

public java.util.Iterator<Pair<T1,T2>> iterator()
Returns:
iterator at the begining of the list.

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException