edu.uci.ics.dillenco.simplegraph01
Class HalfEdgeMap<V>

java.lang.Object
  extended by edu.uci.ics.dillenco.simplegraph01.HalfEdgeMap<V>

public final class HalfEdgeMap<V>
extends Object

This class maps HalfEdges 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
HalfEdgeMap(Graph g)
          Create an empty QEdgeMap for the given graph.
 
Method Summary
 void clear()
          Remove all stored values in this map
 V get(HalfEdge halfEdge)
          Retrieve the value associated with the given HalfEdge.
 V get(QEdge qEdge, int rot)
          Retrieve the value associated with the given HalfEdge.
 boolean isEmpty()
          Return whether this map is currently empty.
 V put(HalfEdge halfEdge, V value)
          Store a <HalfEdge,V> pair.
 V put(QEdge qEdge, int rot, V value)
          Store a <HalfEdge,V> pair, where the HalfEdge is specified as a <QEdge,rot> pair.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HalfEdgeMap

public HalfEdgeMap(Graph g)
Create an empty QEdgeMap for the given graph.

Parameters:
g - the graph with which this map is to be associated.
Method Detail

put

public V put(HalfEdge halfEdge,
             V value)
Store a <HalfEdge,V> pair.

Parameters:
halfEdge - the HalfEdge for the pair, which functions as the key
value - the associated value
Returns:
the previous value associated with the HalfEdge, or null if there was no previous mapping for the HalfEdge.

put

public V put(QEdge qEdge,
             int rot,
             V value)
Store a <HalfEdge,V> pair, where the HalfEdge is specified as a <QEdge,rot> pair.

Parameters:
qEdge - the QEdge for the HalfEdge, which functions as part of the key
rot - the rotation coefficient for the HalfEdge, which functions as part of the key
value - the associated value
Returns:
the previous value associated with the QEdge, or null if there was no previous mapping for the QEdge.

get

public V get(HalfEdge halfEdge)
Retrieve the value associated with the given HalfEdge.

Parameters:
halfEdge - the HalfEdge
Returns:
the associated value.

get

public V get(QEdge qEdge,
             int rot)
Retrieve the value associated with the given HalfEdge. where the HalfEdge is specified as a <QEdge,rot> pair.

Parameters:
qEdge - the QEdge for the HalfEdge
rot - the rotation coefficient for the HalfEdge
Returns:
the associated value.

clear

public void clear()
Remove all stored values in this map


isEmpty

public boolean isEmpty()
Return whether this map is currently empty.

Returns:
true if the map is empty.