Module com.aoapps.hodgepodge
Package com.aoapps.hodgepodge.graph
Class TrivialGraph<V,E extends Edge<V>,Ex extends Exception>
- java.lang.Object
-
- com.aoapps.hodgepodge.graph.TrivialGraph<V,E,Ex>
-
- Type Parameters:
Ex- An arbitrary exception type that may be thrown
- 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>
-
-