datastructures

net.datastructures
Class AdjacencyListGraph.MyEdge

java.lang.Object
  extended bynet.datastructures.HashTable
      extended bynet.datastructures.AdjacencyListGraph.MyPosition
          extended bynet.datastructures.AdjacencyListGraph.MyEdge
All Implemented Interfaces:
DecorablePosition, Edge, Map, Position
Enclosing class:
AdjacencyListGraph

protected static class AdjacencyListGraph.MyEdge
extends AdjacencyListGraph.MyPosition
implements Edge

Implementation of an edge for an undirected adjacency list graph. Each edge stores its endpoints (end vertices), its positions within the incidence containers of its endpoints, and position in the edge container of the graph.


Nested Class Summary
 
Nested classes inherited from class net.datastructures.HashTable
HashTable.DefaultEqualityTester, HashTable.HashEntry
 
Field Summary
protected  Position[] I
          The positions of the entries for the edge in the incidence containers of the end vertices.
protected  Position loc
          The position of the edge in the edge container of the graph.
protected  AdjacencyListGraph.MyVertex[] V
          The end vertices of the edge.
 
Fields inherited from class net.datastructures.AdjacencyListGraph.MyPosition
elem
 
Fields inherited from class net.datastructures.HashTable
A, AVAILABLE, n, N, scale, shift, T
 
Method Summary
 AdjacencyListGraph.MyVertex[] endVertices()
          Returns the end vertices of the edge.
 Position[] incidences()
          Returns the positions of the edge in the incidence containers of its end vertices.
 Position location()
          Returns the position of the edge in the edge container of the graph.
 void setIncidences(Position pv, Position pw)
          Sets the positions of the edge in the incidence containers of its end vertices.
 void setLocation(Position p)
          Sets the position of the edge in the edge container of the graph.
 String toString()
          Returns a string representation of the edge via a tuple of vertices.
 
Methods inherited from class net.datastructures.AdjacencyListGraph.MyPosition
element, setElement
 
Methods inherited from class net.datastructures.HashTable
checkKey, findEntry, get, hashValue, isEmpty, keys, put, rehash, remove, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.datastructures.Position
element
 
Methods inherited from interface net.datastructures.Map
get, isEmpty, keys, put, remove, size, values
 

Field Detail

V

protected AdjacencyListGraph.MyVertex[] V
The end vertices of the edge.


I

protected Position[] I
The positions of the entries for the edge in the incidence containers of the end vertices.


loc

protected Position loc
The position of the edge in the edge container of the graph.

Method Detail

endVertices

public AdjacencyListGraph.MyVertex[] endVertices()
Returns the end vertices of the edge. There are always two elements in the returned array.


incidences

public Position[] incidences()
Returns the positions of the edge in the incidence containers of its end vertices. The returned array always contains two elements.


setIncidences

public void setIncidences(Position pv,
                          Position pw)
Sets the positions of the edge in the incidence containers of its end vertices.


location

public Position location()
Returns the position of the edge in the edge container of the graph.


setLocation

public void setLocation(Position p)
Sets the position of the edge in the edge container of the graph.


toString

public String toString()
Returns a string representation of the edge via a tuple of vertices.


datastructures