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

All Superinterfaces:
java.lang.Cloneable, UndirectedLongGraph.Edge
Enclosing interface:
UndirectedMutableLongGraph

public static interface UndirectedMutableLongGraph.Edge
extends UndirectedLongGraph.Edge

The extension of UndirectedLongGraph.Edge to be mutable.

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

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

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

remove

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

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

clone

UndirectedMutableLongGraph.Edge clone()
Description copied from interface: UndirectedLongGraph.Edge
Clone this edge.

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