Ignore:
Timestamp:
Oct 21, 2010, 9:47:43 PM (14 years ago)
Author:
toshi
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/localSpectral/src/data/GraphBuilder.java

    r27 r32  
    22package data;
    33
     4import clustering.Edge;
     5import clustering.VertexString;
    46import edu.uci.ics.jung.graph.Graph;
    57import edu.uci.ics.jung.graph.SparseGraph;
     
    1618
    1719
    18 public class GraphBuilder<V,E> {
     20public class GraphBuilder {
    1921
    20     Graph<String,Integer> graph;
     22    Graph<String,Edge<String>> graph;
    2123
    2224    public GraphBuilder(){
    23         graph = new SparseGraph<String, Integer>();
     25        graph = new SparseGraph<String, Edge<String>>();
    2426
    2527    }
    2628
    27     public Graph<String, Integer> getGraph() {
     29    public Graph<String, Edge<String>> getGraph() {
    2830        return graph;
    2931    }
     
    4547                    String[] splitted = read.trim().split(",");
    4648                    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]);
    4850                    edge++;
    4951                }
Note: See TracChangeset for help on using the changeset viewer.