@Test public void testToString() { Global.randomSeed(); UGraph<String> graph = new DiskUGraph(r()); UNode<String> a = graph.add("a"), b = graph.add("b"); graph.add("c"); a.connect(b); System.out.println(graph); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("graph {"); Set<UNode<String>> nodes = new HashSet<UNode<String>>(nodes()); int i = 0; for(ULink<String> link : links()) { if(i++ != 0) sb.append(";"); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(UNode<String> node : nodes) { if(i++ != 0) sb.append(";"); sb.append(node); } sb.append("}"); return sb.toString(); }
DiskUGraph implements UGraph<String>, FastWalkable<String, UNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("graph {"); Set<UNode<String>> nodes = new HashSet<UNode<String>>(nodes()); int i = 0; for(ULink<String> link : links()) { if(i++ != 0) sb.append(";"); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(UNode<String> node : nodes) { if(i++ != 0) sb.append(";"); sb.append(node); } sb.append("}"); return sb.toString(); } }
DiskUGraph implements UGraph<String>, FastWalkable<String, UNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("graph {"); Set<UNode<String>> nodes = new HashSet<UNode<String>>(nodes()); int i = 0; for(ULink<String> link : links()) { if(i++ != 0) sb.append(";"); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(UNode<String> node : nodes) { if(i++ != 0) sb.append(";"); sb.append(node); } sb.append("}"); return sb.toString(); } DiskUGraph(File dbFile);  DiskUGraph(File dbFile, boolean nullLabels); }
DiskUGraph implements UGraph<String>, FastWalkable<String, UNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("graph {"); Set<UNode<String>> nodes = new HashSet<UNode<String>>(nodes()); int i = 0; for(ULink<String> link : links()) { if(i++ != 0) sb.append(";"); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(UNode<String> node : nodes) { if(i++ != 0) sb.append(";"); sb.append(node); } sb.append("}"); return sb.toString(); } DiskUGraph(File dbFile);  DiskUGraph(File dbFile, boolean nullLabels); @Override int size(); @Override long numLinks(); @Override UNode<String> node(String label); @Override Collection<? extends UNode<String>> nodes(String label); @Override List<? extends UNode<String>> nodes(); @Override Iterable<? extends ULink<String>> links(); @Override UNode<String> add(String label); @Override Set<String> labels(); @Override boolean connected(String from, String to); @Override long state(); String toString(); void sort(); static DiskUGraph copy(Graph<String> graph, File db); @Override int hashCode(); boolean equals(Object other); @Override UNode<String> get(int i); @SuppressWarnings("unchecked") @Override Class<? extends UGraph<String>> level(); @Override List<UNode<String>> neighborsFast(Node<String> node); static DiskUGraph fromDB(File dbFile); static DiskUGraph fromFile(File file, File dir); static DiskUGraph fromFile(File file, File tmpDir, File dbFile); void close(); }
DiskUGraph implements UGraph<String>, FastWalkable<String, UNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("graph {"); Set<UNode<String>> nodes = new HashSet<UNode<String>>(nodes()); int i = 0; for(ULink<String> link : links()) { if(i++ != 0) sb.append(";"); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(UNode<String> node : nodes) { if(i++ != 0) sb.append(";"); sb.append(node); } sb.append("}"); return sb.toString(); } DiskUGraph(File dbFile);  DiskUGraph(File dbFile, boolean nullLabels); @Override int size(); @Override long numLinks(); @Override UNode<String> node(String label); @Override Collection<? extends UNode<String>> nodes(String label); @Override List<? extends UNode<String>> nodes(); @Override Iterable<? extends ULink<String>> links(); @Override UNode<String> add(String label); @Override Set<String> labels(); @Override boolean connected(String from, String to); @Override long state(); String toString(); void sort(); static DiskUGraph copy(Graph<String> graph, File db); @Override int hashCode(); boolean equals(Object other); @Override UNode<String> get(int i); @SuppressWarnings("unchecked") @Override Class<? extends UGraph<String>> level(); @Override List<UNode<String>> neighborsFast(Node<String> node); static DiskUGraph fromDB(File dbFile); static DiskUGraph fromFile(File file, File dir); static DiskUGraph fromFile(File file, File tmpDir, File dbFile); void close(); static final int NEIGHBOR_CAPACITY; }