de.fhstralsund.vinets.structure
Interface Edge

All Superinterfaces:
java.lang.Cloneable, Link, NetElement, java.io.Serializable
All Known Implementing Classes:
SimpleGraph.SimpleEdge

public interface Edge
extends Link

An Edge object models a directed or undirected Edge of a simple Graph. Normally, a class which implements this interface has no public constructor, but its instances are created by a factory method of the corresponding Graph class.


Method Summary
 NodePair getEnds()
          Delivers both end Nodes of this Edge.
 Node getOtherEnd(Node v)
          Delivers the end Node of an Edge different from the given one.
 Node getSource()
          Delivers the source Node of an Edge.
 Node getTarget()
          Delivers the target Node of an Edge.
 
Methods inherited from interface de.fhstralsund.vinets.structure.Link
incidentNodes, isDirected, isUndirected
 
Methods inherited from interface de.fhstralsund.vinets.structure.NetElement
clearLabels, containsLabel, getBooleanLabel, getData, getDoubleLabel, getGeometry, getHost, getID, getIntLabel, getLabel, getLabelKeySet, getName, getOriginal, getRepresentation, removeLabel, setBooleanLabel, setData, setDoubleLabel, setGeometry, setIntLabel, setLabel, setName, setRepresentation
 

Method Detail

getSource

Node getSource()
Delivers the source Node of an Edge. If the Edge is undirected, one of its ends is delivered arbitrarily. The other end should be delivered by the getTarget() method.

Returns:
the start vertex of this Edge.

getTarget

Node getTarget()
Delivers the target Node of an Edge. If the Edge is undirected, one of its ends is delivered arbitrarily. The other end should be delivered by the getSource() method.

Returns:
the end vertex of this Edge.

getEnds

NodePair getEnds()
Delivers both end Nodes of this Edge.

Returns:
the two ends of this Edge encapsulated in a NodePair.

getOtherEnd

Node getOtherEnd(Node v)
Delivers the end Node of an Edge different from the given one.

Parameters:
v - one of the end vertices of this Edge.
Returns:
the opposite end vertex of this Edge.
Throws:
java.lang.IllegalArgumentException - if v is not incident to this Edge.