|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.uci.ics.dillenco.simplegraph01.NodeMap<V>
public final class NodeMap<V>
This class maps Nodes of a given graph to user-defined attributes.
it provides a scaled-down version
of mapping: only put, get, clear,
and isEmpty are supported.
| Constructor Summary | |
|---|---|
NodeMap(Graph g)
Create an empty NodeMap for the given graph. |
|
| Method Summary | |
|---|---|
void |
clear()
Remove all stored values in this map |
V |
get(Node node)
Retrieve the value associated with the given Node. |
boolean |
isEmpty()
Return whether this map is currently empty. |
V |
put(Node node,
V value)
Store a <Node,V> pair. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NodeMap(Graph g)
g - the graph with which this map is to be associated.| Method Detail |
|---|
public V put(Node node,
V value)
<Node,V> pair.
- Parameters:
node - the Node for the pair, which functions as the keyvalue - the associated value
- Returns:
- the previous value associated with the Node, or null if
there was no previous mapping for the Node.
public V get(Node node)
node - the Node
public void clear()
public boolean isEmpty()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||