org.grinvin.graphs

Interface Edge

All Superinterfaces:
Element
Known Implementing Classes:
DefaultEdge

public interface Edge
extends Element

Represents a single (possibly directed) edge in a graph. Every edge has two vertices as endpoints, called 'first' and 'second' endpoint. The order of these vertices is immaterial when the graph is undirected.

When an edge belongs to a graph, also its endpoints should be vertices of that graph.

Method Summary

Vertex
getFirstEndpoint()
The first endpoint vertex of this edge.
Vertex
getSecondEndpoint()
The second endpoint vertex of this edge.

Method Details

getFirstEndpoint

public Vertex getFirstEndpoint()
The first endpoint vertex of this edge.
Returns:
The first endpoint of this edge

getSecondEndpoint

public Vertex getSecondEndpoint()
The second endpoint vertex of this edge.
Returns:
The second endpoint of this edge