Package com.aoindustries.util.graph
Class TrivialGraph<V,E extends Edge<V>,EX extends Exception>
- java.lang.Object
-
- com.aoindustries.util.graph.TrivialGraph<V,E,EX>
-
- All Implemented Interfaces:
Graph<V,E,EX>,MultiGraph<V,E,EX>,SymmetricGraph<V,E,EX>,SymmetricMultiGraph<V,E,EX>
public class TrivialGraph<V,E extends Edge<V>,EX extends Exception> extends Object implements SymmetricGraph<V,E,EX>
A trivial graph is unmodifiable and has one vertex and no edges.- Author:
- AO Industries, Inc.
-
-
Constructor Summary
Constructors Constructor Description TrivialGraph(V vertex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<E>getEdgesFrom(V from)Gets the edges from the provided vertex.Set<E>getEdgesTo(V to)Gets the edges to the provided vertex.Set<V>getVertices()Gets the set of vertices for this graph.
-
-
-
Constructor Detail
-
TrivialGraph
public TrivialGraph(V vertex)
-
-
Method Detail
-
getVertices
public Set<V> getVertices()
Description copied from interface:MultiGraphGets the set of vertices for this graph.- Specified by:
getVerticesin interfaceMultiGraph<V,E extends Edge<V>,EX extends Exception>
-
getEdgesFrom
public Set<E> getEdgesFrom(V from)
Description copied from interface:GraphGets the edges from the provided vertex. The vertex must be part of this graph, and the results are undefined if it is not. A graph only allows unique combinations of from and to vertices.
-
getEdgesTo
public Set<E> getEdgesTo(V to)
Description copied from interface:SymmetricGraphGets the edges to the provided vertex. The vertex must be part of this graph, and the results are undefined if it is not. A graph only allows unique combinations of from and to vertices.- Specified by:
getEdgesToin interfaceSymmetricGraph<V,E extends Edge<V>,EX extends Exception>- Specified by:
getEdgesToin interfaceSymmetricMultiGraph<V,E extends Edge<V>,EX extends Exception>
-
-