edu.umd.cloud9.example.pagerank
Class PageRankNode

java.lang.Object
  extended by edu.umd.cloud9.example.pagerank.PageRankNode
All Implemented Interfaces:
Writable

public class PageRankNode
extends Object
implements Writable

Representation of a graph node for PageRank.

Author:
Jimmy Lin, Michael Schatz

Nested Class Summary
static class PageRankNode.Type
           
 
Constructor Summary
PageRankNode()
           
 
Method Summary
static PageRankNode create(byte[] bytes)
          Creates object from a byte array.
static PageRankNode create(DataInput in)
          Creates object from a DataInput.
 ArrayListOfIntsWritable getAdjacenyList()
           
 int getNodeId()
           
 float getPageRank()
           
 PageRankNode.Type getType()
           
 void readFields(DataInput in)
          Deserializes this object.
 byte[] serialize()
          Returns the serialized representation of this object as a byte array.
 void setAdjacencyList(ArrayListOfIntsWritable list)
           
 void setNodeId(int n)
           
 void setPageRank(float p)
           
 void setType(PageRankNode.Type type)
           
 String toString()
           
 void write(DataOutput out)
          Serializes this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageRankNode

public PageRankNode()
Method Detail

getPageRank

public float getPageRank()

setPageRank

public void setPageRank(float p)

getNodeId

public int getNodeId()

setNodeId

public void setNodeId(int n)

getAdjacenyList

public ArrayListOfIntsWritable getAdjacenyList()

setAdjacencyList

public void setAdjacencyList(ArrayListOfIntsWritable list)

getType

public PageRankNode.Type getType()

setType

public void setType(PageRankNode.Type type)

readFields

public void readFields(DataInput in)
                throws IOException
Deserializes this object.

Specified by:
readFields in interface Writable
Parameters:
in - source for raw byte representation
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Serializes this object.

Specified by:
write in interface Writable
Parameters:
out - where to write the raw byte representation
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

serialize

public byte[] serialize()
                 throws IOException
Returns the serialized representation of this object as a byte array.

Returns:
byte array representing the serialized representation of this object
Throws:
IOException

create

public static PageRankNode create(DataInput in)
                           throws IOException
Creates object from a DataInput.

Parameters:
in - source for reading the serialized representation
Returns:
newly-created object
Throws:
IOException

create

public static PageRankNode create(byte[] bytes)
                           throws IOException
Creates object from a byte array.

Parameters:
bytes - raw serialized representation
Returns:
newly-created object
Throws:
IOException