net.datastructures - version 3.0

net.datastructures
Class AdjacencyListGraph.MyVertex

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

protected static class AdjacencyListGraph.MyVertex
extends AdjacencyListGraph.MyPosition
implements Vertex

Implementation of a vertex for an undirected adjacency list graph. Each vertex stores its incidence container and position in the vertex container of the graph.


Nested Class Summary
 
Nested classes inherited from class net.datastructures.HashTable
HashTable.DefaultEqualityTester, HashTable.HashEntry
 
Field Summary
protected  List I
          Incidence container of the vertex.
protected  Position loc
          Position of the vertex in the vertex container of the graph.
 
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
 int degree()
          Return the degree of a given vertex
 Iterator incidentEdges()
          Returns the incident edges on this vertex.
 Position insertIncidence(Edge e)
          Inserts an edge into the incidence container of this vertex.
 Position location()
          Returns the position of this vertex in the vertex container of the graph.
 void removeIncidence(Position p)
          Removes an edge from the incidence container of this vertex.
 void setLocation(Position p)
          Sets the position of this vertex in the vertex container of the graph.
 String toString()
          Returns a string representation of the element stored at this vertex.
 
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

I

protected List I
Incidence container of the vertex.


loc

protected Position loc
Position of the vertex in the vertex container of the graph.

Method Detail

degree

public int degree()
Return the degree of a given vertex


incidentEdges

public Iterator incidentEdges()
Returns the incident edges on this vertex.


insertIncidence

public Position insertIncidence(Edge e)
Inserts an edge into the incidence container of this vertex.


removeIncidence

public void removeIncidence(Position p)
Removes an edge from the incidence container of this vertex.


location

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


setLocation

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


toString

public String toString()
Returns a string representation of the element stored at this vertex.


net.datastructures - version 3.0