net.datastructures - version 5.0

net.datastructures
Class AdjacencyListGraph.MyEdge<E>

java.lang.Object
  extended by net.datastructures.HashTableMap<Object,Object>
      extended by net.datastructures.AdjacencyListGraph.MyPosition<E>
          extended by net.datastructures.AdjacencyListGraph.MyEdge<E>
All Implemented Interfaces:
DecorablePosition<E>, Edge<E>, Map<Object,Object>, Position<E>
Enclosing class:
AdjacencyListGraph<V,E>

protected class AdjacencyListGraph.MyEdge<E>
extends AdjacencyListGraph.MyPosition<E>
implements Edge<E>

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/interfaces inherited from class net.datastructures.HashTableMap
HashTableMap.HashEntry<K,V>
 
Field Summary
protected  AdjacencyListGraph.MyVertex<V>[] endVertices
          The end vertices of the edge.
protected  Position<Edge<E>>[] Inc
          The positions of the entries for the edge in the incidence containers of the end vertices.
protected  Position<Edge<E>> loc
          The position of the edge in the edge container of the graph.
 
Fields inherited from class net.datastructures.AdjacencyListGraph.MyPosition
elem
 
Fields inherited from class net.datastructures.HashTableMap
AVAILABLE, bucket, capacity, n, prime, scale, shift
 
Method Summary
 AdjacencyListGraph.MyVertex<V>[] endVertices()
          Returns the end vertices of the edge.
 Position<Edge<E>>[] incidences()
          Returns the positions of the edge in the incidence containers of its end vertices.
 Position<Edge<E>> location()
          Returns the position of the edge in the edge container of the graph.
 void setIncidences(Position<Edge<E>> pv, Position<Edge<E>> pw)
          Sets the positions of the edge in the incidence containers of its end vertices.
 void setLocation(Position<Edge<E>> 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.HashTableMap
checkKey, entrySet, findEntry, get, hashValue, isEmpty, keySet, 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
entrySet, get, isEmpty, keySet, put, remove, size, values
 

Field Detail

endVertices

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


Inc

protected Position<Edge<E>>[] Inc
The positions of the entries for the edge in the incidence containers of the end vertices.


loc

protected Position<Edge<E>> loc
The position of the edge in the edge container of the graph.

Method Detail

endVertices

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


incidences

public Position<Edge<E>>[] 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<Edge<E>> pv,
                          Position<Edge<E>> pw)
Sets the positions of the edge in the incidence containers of its end vertices.


location

public Position<Edge<E>> location()
Returns the position of the edge in the edge container of the graph.


setLocation

public void setLocation(Position<Edge<E>> 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.

Overrides:
toString in class Object

net.datastructures - version 5.0