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

Type Parameters:
V - The vertices in the graph.
All Superinterfaces:
java.lang.Cloneable, UndirectedGraph.Edge<V>
Enclosing interface:
UndirectedMutableGraph<V>

public static interface UndirectedMutableGraph.Edge<V>
extends UndirectedGraph.Edge<V>

The extension of UndirectedGraph.Edge to be mutable.

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

Method Summary
 UndirectedMutableGraph.Edge<V> clone()
          Clone this edge.
 double remove()
          Remove this edge.
 double setWeight(double weight)
          Set the weight of this edge.
 
Methods inherited from interface de.aitools.aq.graph.weighted.UndirectedGraph.Edge
exists, getVertexA, getVertexB, getWeight, isConnectedTo
 

Method Detail

setWeight

double setWeight(double weight)
Set the weight of this edge. This should always be the same as calling UndirectedMutableGraph.setEdgeWeight(Object, Object, double) using the two vertices of this edge as parameter.
Setting the weight to UndirectedGraph.getUnconnectedWeight() should be the same as calling remove().

Parameters:
weight - The new weight of the edge.
Returns:
The old weight or UndirectedGraph.getUnconnectedWeight() if the edge had not existed (see UndirectedGraph.Edge.exists()).
Throws:
java.util.NoSuchElementException - If at least one of the two vertices is not a part of the graph any more (see UndirectedGraph.containsVertex(Object)).

remove

double remove()
Remove this edge. This should always be the same as calling UndirectedMutableGraph.removeEdge(Object, Object) using the two vertices of this edge as parameter.

Returns:
The old weight or UndirectedGraph.getUnconnectedWeight() if the edge had not existed (see UndirectedGraph.Edge.exists()).
Throws:
java.util.NoSuchElementException - If at least one of the two vertices is not a part of the graph any more (see UndirectedGraph.containsVertex(Object)).

clone

UndirectedMutableGraph.Edge<V> clone()
Description copied from interface: UndirectedGraph.Edge
Clone this edge.

Specified by:
clone in interface UndirectedGraph.Edge<V>
Returns:
A copy of this edge.