uk.ed.inf.graph.basic
Interface IBasicEdge<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>

Type Parameters:
N - The node class that must implement the INode class.
E - The edge class that must implement this interface.
All Superinterfaces:
java.lang.Comparable<E>
All Known Subinterfaces:
ICompoundEdge<N,E>, IDirectedEdge<N,E>, IUndirectedEdge<N,E>
All Known Implementing Classes:
ArchetypalCompoundEdge, BaseCompoundEdge, CompoundEdge, Edge

public interface IBasicEdge<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>
extends java.lang.Comparable<E>

An edge in a graph. By default this is undirected.

Author:
smoodie

Method Summary
 IBasicPair<N,E> getConnectedNodes()
          Get the ends of
 IBasicGraph<N,E> getGraph()
          Get the owning graph of this edge.
 int getIndex()
          Get the index that uniquely identifies the edge within its owning graph.
 boolean hasEnds(IBasicPair<? super N,? super E> ends)
          Tests if this edge has these ends.
 boolean isRemoved()
          Test if the edge has been removed from the graph.
 boolean isSelfEdge()
          Is this a self edge, i.e.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getGraph

IBasicGraph<N,E> getGraph()
Get the owning graph of this edge.

Returns:
the owning graph.

getIndex

int getIndex()
Get the index that uniquely identifies the edge within its owning graph.

Returns:
The index, which is a While number (>-0).

getConnectedNodes

IBasicPair<N,E> getConnectedNodes()
Get the ends of

Returns:

isSelfEdge

boolean isSelfEdge()
Is this a self edge, i.e. both ends are the same node.

Returns:
true if removed.

hasEnds

boolean hasEnds(IBasicPair<? super N,? super E> ends)
Tests if this edge has these ends. Ignores the directions of the ends.

Parameters:
ends - The ends to be tested.
Returns:
true if the edge contains the ends, false otherwise.

isRemoved

boolean isRemoved()
Test if the edge has been removed from the graph.

Returns:
true if removed, false otherwise.