de.aitools.aq.graph.weighted
Interface UndirectedMutableIntGraph.Edge

All Superinterfaces:
java.lang.Cloneable, UndirectedIntGraph.Edge
Enclosing interface:
UndirectedMutableIntGraph

public static interface UndirectedMutableIntGraph.Edge
extends UndirectedIntGraph.Edge

The extension of UndirectedIntGraph.Edge to be mutable.

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

Method Summary
 UndirectedMutableIntGraph.Edge 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.UndirectedIntGraph.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 UndirectedMutableIntGraph.setEdgeWeight(int, int, double) using the two vertices of this edge as parameter.
Setting the weight to UndirectedIntGraph.getUnconnectedWeight() should be the same as calling remove().

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

remove

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

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

clone

UndirectedMutableIntGraph.Edge clone()
Description copied from interface: UndirectedIntGraph.Edge
Clone this edge.

Specified by:
clone in interface UndirectedIntGraph.Edge
Returns:
A copy of this edge.