de.aitools.aq.graph.weighted
Interface UndirectedMutableGraph<V>

Type Parameters:
V - The vertices in this graph.
All Superinterfaces:
java.lang.Iterable<V>, UndirectedGraph<V>
All Known Implementing Classes:
ComparablesUndirectedGraph, GeneralUndirectedGraph

Deprecated. see package de.aitools.aq.structure.graph

public interface UndirectedMutableGraph<V>
extends UndirectedGraph<V>

An extension of an UndirectedGraph. The graph can be changed after it was created.

Version:
$Id: UndirectedMutableGraph.java,v 1.2 2011/09/29 12:43:03 dogu3912 Exp $
Author:
johannes.kiesel(/\t)uni-weimar.de

Nested Class Summary
static interface UndirectedMutableGraph.Edge<V>
          Deprecated. The extension of UndirectedGraph.Edge to be mutable.
 
Field Summary
 
Fields inherited from interface de.aitools.aq.graph.weighted.UndirectedGraph
DEFAULT_UNCONNECTED_WEIGHT
 
Method Summary
 boolean addVertex(V vertex)
          Deprecated. Add a vertex to the graph.
 java.util.Iterator<? extends UndirectedMutableGraph.Edge<V>> edges()
          Deprecated. Get an iterator over all edges of the graph.
 java.util.Iterator<? extends UndirectedMutableGraph.Edge<V>> edgesConnectedTo(V vertex)
          Deprecated. Get an iterator over all edges in the graph, given vertex is connected with.
 UndirectedMutableGraph.Edge<V> getEdge(V vertexA, V vertexB)
          Deprecated. Get the UndirectedGraph.Edge connecting the two vertices.
 double removeEdge(V vertexA, V vertexB)
          Deprecated. Remove a edge determined by two vertices.
 boolean removeVertex(V vertex)
          Deprecated. Remove a vertex from the graph.
 double setEdgeWeight(V vertexA, V vertexB, double weight)
          Deprecated. Set the weight of a edge determined by two vertices.
 void setUnconnectedWeight(double unconnectedWeight)
          Deprecated. Change the weight that is returned by UndirectedGraph.getEdgeWeight(Object, Object) if the two vertices are not connected.
 
Methods inherited from interface de.aitools.aq.graph.weighted.UndirectedGraph
containsEdge, containsVertex, getEdgeWeight, getUnconnectedWeight, numEdges, numEdges, numVertices, vertices, verticesConnectedTo
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

setUnconnectedWeight

void setUnconnectedWeight(double unconnectedWeight)
Deprecated. 
Change the weight that is returned by UndirectedGraph.getEdgeWeight(Object, Object) if the two vertices are not connected. This will remove all edges that currently have unconnectedWeight as their weight.

Parameters:
unconnectedWeight - The new weight for unconnected vertices.

edges

java.util.Iterator<? extends UndirectedMutableGraph.Edge<V>> edges()
Deprecated. 
Description copied from interface: UndirectedGraph
Get an iterator over all edges of the graph. Each edge is only visited once.

Specified by:
edges in interface UndirectedGraph<V>
Returns:
The iterator.
See Also:
UndirectedGraph.numEdges()

edgesConnectedTo

java.util.Iterator<? extends UndirectedMutableGraph.Edge<V>> edgesConnectedTo(V vertex)
Deprecated. 
Description copied from interface: UndirectedGraph
Get an iterator over all edges in the graph, given vertex is connected with.

Specified by:
edgesConnectedTo in interface UndirectedGraph<V>
Parameters:
vertex - The vertex.
Returns:
The iterator.
See Also:
UndirectedGraph.numEdges(Object)

getEdge

UndirectedMutableGraph.Edge<V> getEdge(V vertexA,
                                       V vertexB)
Deprecated. 
Description copied from interface: UndirectedGraph
Get the UndirectedGraph.Edge connecting the two vertices. The object will also be returned if there does not exists such an edge in the graph. Use UndirectedGraph.Edge.exists() to check.

Specified by:
getEdge in interface UndirectedGraph<V>
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
The edge.
See Also:
UndirectedGraph.containsEdge(Object, Object), UndirectedGraph.getEdgeWeight(Object, Object)

addVertex

boolean addVertex(V vertex)
Deprecated. 
Add a vertex to the graph.

Parameters:
vertex - The vertex to be added.
Returns:
True if the graph changed during this call. False if the graph already contained that vertex.
Throws:
java.lang.NullPointerException - If vertex is null.

removeVertex

boolean removeVertex(V vertex)
Deprecated. 
Remove a vertex from the graph.

Parameters:
vertex - The vertex to be removed.
Returns:
True if the graph changed during this call. False if the graph has not contained that vertex.
Throws:
java.lang.NullPointerException - If vertex is null.

setEdgeWeight

double setEdgeWeight(V vertexA,
                     V vertexB,
                     double weight)
Deprecated. 
Set the weight of a edge determined by two vertices. If the new weight is UndirectedGraph.getUnconnectedWeight(), this should be the same as calling removeEdge(Object, Object). The old weight of the edge is returned, which may be UndirectedGraph.getUnconnectedWeight() if the edge had not existed.

Parameters:
vertexA - One vertex of the edge.
vertexB - The other vertex of the edge.
weight - The new weight of the edge.
Returns:
The value that would have been returned by a call to UndirectedGraph.getEdgeWeight(Object, Object) directly before this call.
Throws:
java.util.NoSuchElementException - If at least one of the two vertices is not a part of the graph (see UndirectedGraph.containsVertex(Object)).
java.lang.NullPointerException - If at least one vertex is null.

removeEdge

double removeEdge(V vertexA,
                  V vertexB)
Deprecated. 
Remove a edge determined by two vertices. The old weight of the edge is returned, which may be UndirectedGraph.getUnconnectedWeight() if the edge had not existed (in which case nothing has happened).

Parameters:
vertexA - One vertex of the edge.
vertexB - The other vertex of the edge.
Returns:
The value that would have been returned by a call to UndirectedGraph.getEdgeWeight(Object, Object) directly before this call.
Throws:
java.util.NoSuchElementException - If at least one of the two vertices is not a part of the graph (see UndirectedGraph.containsVertex(Object)).
java.lang.NullPointerException - If at least one vertex is null.