uk.ed.inf.graph.util
Interface IDirectedEdgeSet<N extends IDirectedNode<N,? extends IDirectedEdge<N,?>>,E extends IDirectedEdge<N,E>>

Type Parameters:
N - The node class to be used. It must implement INode.
E - The edge class to be used. It must implement IEdge.
All Superinterfaces:
java.util.Collection<E>, IEdgeSet<N,E>, java.lang.Iterable<E>, java.util.Set<E>
All Known Implementing Classes:
DirectedEdgeSet

public interface IDirectedEdgeSet<N extends IDirectedNode<N,? extends IDirectedEdge<N,?>>,E extends IDirectedEdge<N,E>>
extends IEdgeSet<N,E>

A set designed to provide convenient access to directed edges. This interface will typically be implemented and used as a data structure with the graph library classes themselves rather than by clients of the library. The set does not ensure that the edges all belong to the same graph (although this is recommended and the client should ensure this), it only requires that the edge indexes are unique, based on equals() and their comparitor.

Author:
smoodie

Method Summary
 boolean contains(N outNode, N inNode)
          Does the edge set contain at least one edge with these nodes.
 java.util.SortedSet<E> get(N inNode, N outNode)
          Get the edges that match the given node connectivity.
 
Methods inherited from interface uk.ed.inf.graph.util.IEdgeSet
contains, get, getEdgesWith, hasEdgesWith
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

contains

boolean contains(N outNode,
                 N inNode)
Does the edge set contain at least one edge with these nodes. This assumes a direction to the nodes so if the edges are undirected the method must be called for both orientations of the edge.

Specified by:
contains in interface IEdgeSet<N extends IDirectedNode<N,? extends IDirectedEdge<N,?>>,E extends IDirectedEdge<N,E>>
Parameters:
outNode - The node from which the edge is leading out from.
inNode - The node from which the edge is leading into.
Returns:
True if one or more edges has this connectivity, false otherwise.

get

java.util.SortedSet<E> get(N inNode,
                           N outNode)
Get the edges that match the given node connectivity. The connectivity is directed so to find an undirected edge the reciprocal node connectivity may need to be used.

Specified by:
get in interface IEdgeSet<N extends IDirectedNode<N,? extends IDirectedEdge<N,?>>,E extends IDirectedEdge<N,E>>
Parameters:
outNode - The node that the edge is leading out from. Cannot be null.
inNode - The node that the edge is leading into. Cannot be null.
Returns:
The set of edges containing this connectivity. Note that the set is guaranteed to contain at least one edge.
Throws:
java.lang.NullPointerException - if the parameters are null.
java.lang.IllegalArgumentException - if contains(N outNode, N inNode) == false