public class Util
extends java.lang.Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static <V extends Vertex,E extends Edge<V>> |
copyGraph(Graph<V,E> graph)
Creates a copy of a graph
|
static <V extends Vertex,E extends Edge<V>> |
createEdge(V origin,
V destination,
java.lang.Class<?> edgeClass)
Creates a graph edge between two vertices of the given class
|
static <V extends Vertex> |
createVertex(java.lang.Class<?> vertexClass)
Creates a vertex of the given class
|
static <V extends Vertex,E extends Edge<V>> |
generateRandomGraph(int numberOfVertices,
java.lang.Class<?> vertexClass,
int numberOfEdges,
java.lang.Class<?> edgesClass)
Generates a random graph
|
static <T> void |
reverseList(java.util.List<T> list)
Reverses the given list
|
public static <V extends Vertex,E extends Edge<V>> Graph<V,E> copyGraph(Graph<V,E> graph)
V - The vertex typeE - The edge typegraph - Graph to be copiedgraphpublic static <T> void reverseList(java.util.List<T> list)
T - Type od list's elementslist - List to be reversedpublic static <V extends Vertex,E extends Edge<V>> E createEdge(V origin, V destination, java.lang.Class<?> edgeClass)
V - The vertex typeE - The edge typeorigin - The first vertexdestination - The second vertexedgeClass - Class of the edgeorigin and destinationpublic static <V extends Vertex> V createVertex(java.lang.Class<?> vertexClass)
V - The vertex typevertexClass - Vertex classpublic static <V extends Vertex,E extends Edge<V>> java.util.List<?>[] generateRandomGraph(int numberOfVertices, java.lang.Class<?> vertexClass, int numberOfEdges, java.lang.Class<?> edgesClass)
V - The vertex typeE - The edge typenumberOfVertices - Number of vertices the graph will havevertexClass - Vertex classnumberOfEdges - Number of edges the graph will haveedgesClass - Edge class