I - Vertex idE - Edge valuepublic class HashMapEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> extends ConfigurableOutEdges<I,E> implements StrictRandomAccessOutEdges<I,E>, MutableOutEdges<I,E>
| Constructor and Description |
|---|
HashMapEdges() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Edge<I,E> edge)
Add an edge.
|
E |
getEdgeValue(I targetVertexId)
Return the edge value for the given target vertex id (or null if there
is no edge pointing to it).
|
void |
initialize()
Initialize the data structure with the default initial capacity.
|
void |
initialize(int capacity)
Initialize the data structure with the specified initial capacity.
|
void |
initialize(Iterable<Edge<I,E>> edges)
Initialize the data structure and set the edges from an iterable.
|
Iterator<Edge<I,E>> |
iterator() |
Iterator<MutableEdge<I,E>> |
mutableIterator()
Returns an iterator over edges that can be modified in-place,
either by changing the current edge value or by removing the current edge.
|
void |
readFields(DataInput in) |
void |
remove(I targetVertexId)
Remove all edges to the given target vertex.
|
void |
setEdgeValue(I targetVertexId,
E edgeValue)
Set the edge value for the given target vertex id (if an edge to that
vertex exists).
|
int |
size()
Return the number of edges.
|
void |
write(DataOutput out) |
getConf, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic void initialize(Iterable<Edge<I,E>> edges)
OutEdgesinitialize in interface OutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>edges - Iterable of edgespublic void initialize(int capacity)
OutEdgesinitialize in interface OutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>capacity - Initial capacitypublic void initialize()
OutEdgesinitialize in interface OutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>public void add(Edge<I,E> edge)
OutEdgespublic void remove(I targetVertexId)
OutEdgespublic E getEdgeValue(I targetVertexId)
StrictRandomAccessOutEdgesgetEdgeValue in interface StrictRandomAccessOutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>targetVertexId - Target vertex idpublic void setEdgeValue(I targetVertexId, E edgeValue)
StrictRandomAccessOutEdgessetEdgeValue in interface StrictRandomAccessOutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>targetVertexId - Target vertex idedgeValue - Edge valuepublic int size()
OutEdgespublic Iterator<MutableEdge<I,E>> mutableIterator()
MutableOutEdgesmutableIterator in interface MutableOutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>public void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.