Exemplo n.º 1
0
 /** Aufgabe b */
 @Override
 public void load(String fileName) {
   try {
     String content = Helper.loadText(fileName);
     String[] lines = content.split("\r\n");
     ImplGraph newGraph = new ImplGraph();
     for (String line : lines) {
       String[] edge = line.split("-");
       Node<Integer> a = newGraph.setNode(Integer.parseInt(edge[0]));
       Node<Integer> b = newGraph.setNode(Integer.parseInt(edge[1]));
       newGraph.setEdge(a, b);
     }
     this.adjacencyList = newGraph.adjacencyList;
   } catch (IOException e) {
     System.out.println("Ladefehler... f**k!");
   } catch (Exception e) {
     System.out.println("AnyFehler... f**k!");
   }
 }