List of usage examples for org.apache.commons.collections15 FactoryUtils instantiateFactory
public static <T> Factory<T> instantiateFactory(Class<T> classToInstantiate)
From source file:com.google.code.facebook.graph.sna.applet.SimpleGraphDraw.java
/** * Generates a graph: in this case, reads it from the file * "samples/datasetsgraph/simple.net"//from w w w .ja v a 2s . c o m * @return A sample undirected graph */ public static Graph getGraph() throws IOException { PajekNetReader pnr = new PajekNetReader(FactoryUtils.instantiateFactory(Object.class)); Graph g = new UndirectedSparseGraph(); pnr.load("src/main/resources/datasets/simple.net", g); return g; }
From source file:edu.uci.ics.jung.samples.SimpleGraphDraw.java
/** * Generates a graph: in this case, reads it from the file * "samples/datasetsgraph/simple.net"/* w ww . j ava 2 s. c o m*/ * @return A sample undirected graph */ @SuppressWarnings({ "rawtypes", "unchecked" }) public static Graph getGraph() throws IOException { PajekNetReader pnr = new PajekNetReader(FactoryUtils.instantiateFactory(Object.class)); Graph g = new UndirectedSparseGraph(); pnr.load("datasets/simple.net", g); return g; }
From source file:com.gannon.demo.SimpleGraphDraw.java
/** * Generates a graph: in this case, reads it from the file * "samples/datasetsgraph/simple.net"//from w w w.j a v a 2 s.c om * * @return A sample undirected graph */ public static Graph getGraph() throws IOException { PajekNetReader pnr = new PajekNetReader(FactoryUtils.instantiateFactory(Object.class)); Graph g = new UndirectedSparseGraph(); pnr.load("testing/com/gannon/demo/simple.net", g); return g; }