Aggiunto graph

This commit is contained in:
2014-05-20 20:25:19 +02:00
parent 75199b5c96
commit 39d338efdf
6 changed files with 103 additions and 8 deletions

View File

@@ -7,6 +7,12 @@ package graph;
* Time: 16:30
*/
import exceptions.InvalidPositionException;
import map.HashTableMap;
import position.NodePositionList;
import position.Position;
import position.PositionList;
import java.util.Iterator;
/**
@@ -15,7 +21,6 @@ import java.util.Iterator;
* @author Roberto Tamassia, Eric Zamore
*/
/*
public class AdjacencyListGraph<V,E> implements Graph<V,E> {
protected NodePositionList<Vertex<V>> VList; // container for vertices
@@ -179,8 +184,7 @@ public class AdjacencyListGraph<V,E> implements Graph<V,E> {
}
// Implementation of a decorable position by means of a hash table.
protected static class MyPosition<T>
extends HashTableMap<Object,Object> implements DecorablePosition<T> {
protected static class MyPosition<T> extends HashTableMap<Object,Object> implements DecorablePosition<T> {
// The element stored at this position.
protected T elem;
// Returns the element stored at this position.
@@ -223,8 +227,7 @@ public class AdjacencyListGraph<V,E> implements Graph<V,E> {
//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.
protected class MyVertex<V>
extends MyPosition<V> implements Vertex<V> {
protected class MyVertex<V> extends MyPosition<V> implements Vertex<V> {
// Incidence container of the vertex.
protected PositionList<Edge<E>> incEdges;
// Position of the vertex in the vertex container of the graph.
@@ -317,6 +320,4 @@ public class AdjacencyListGraph<V,E> implements Graph<V,E> {
"," + endVertices[1].toString() + ")";
}
}
}
*/
}