Changeset 32 for branches/localSpectral/src/data
- Timestamp:
- Oct 21, 2010, 9:47:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/localSpectral/src/data/GraphBuilder.java
r27 r32 2 2 package data; 3 3 4 import clustering.Edge; 5 import clustering.VertexString; 4 6 import edu.uci.ics.jung.graph.Graph; 5 7 import edu.uci.ics.jung.graph.SparseGraph; … … 16 18 17 19 18 public class GraphBuilder <V,E>{20 public class GraphBuilder { 19 21 20 Graph<String, Integer> graph;22 Graph<String,Edge<String>> graph; 21 23 22 24 public GraphBuilder(){ 23 graph = new SparseGraph<String, Integer>();25 graph = new SparseGraph<String, Edge<String>>(); 24 26 25 27 } 26 28 27 public Graph<String, Integer> getGraph() {29 public Graph<String, Edge<String>> getGraph() { 28 30 return graph; 29 31 } … … 45 47 String[] splitted = read.trim().split(","); 46 48 vertex.addAll(Arrays.asList(splitted)); 47 graph.addEdge( edge, splitted[0], splitted[1]);49 graph.addEdge(new Edge<String>(splitted[0], splitted[1]), splitted[0], splitted[1]); 48 50 edge++; 49 51 }
Note: See TracChangeset
for help on using the changeset viewer.