@Test public void testToString() { Global.randomSeed(); DGraph<String> graph = new DiskDGraph(r()); DNode<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("digraph {"); Set<DNode<String>> nodes = new HashSet<DNode<String>>(nodes()); for(DLink<String> link : links()) { if(sb.length() != 9) sb.append("; "); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(DNode<String> node : nodes) sb.append("; " + node); sb.append("}"); return sb.toString(); }
DiskDGraph implements DGraph<String>, FastWalkable<String, DNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("digraph {"); Set<DNode<String>> nodes = new HashSet<DNode<String>>(nodes()); for(DLink<String> link : links()) { if(sb.length() != 9) sb.append("; "); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(DNode<String> node : nodes) sb.append("; " + node); sb.append("}"); return sb.toString(); } }
DiskDGraph implements DGraph<String>, FastWalkable<String, DNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("digraph {"); Set<DNode<String>> nodes = new HashSet<DNode<String>>(nodes()); for(DLink<String> link : links()) { if(sb.length() != 9) sb.append("; "); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(DNode<String> node : nodes) sb.append("; " + node); sb.append("}"); return sb.toString(); } DiskDGraph(File dbFile);  DiskDGraph(File dbFile, boolean nullLabels); }
DiskDGraph implements DGraph<String>, FastWalkable<String, DNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("digraph {"); Set<DNode<String>> nodes = new HashSet<DNode<String>>(nodes()); for(DLink<String> link : links()) { if(sb.length() != 9) sb.append("; "); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(DNode<String> node : nodes) sb.append("; " + node); sb.append("}"); return sb.toString(); } DiskDGraph(File dbFile);  DiskDGraph(File dbFile, boolean nullLabels); @Override int size(); @Override long numLinks(); @Override DNode<String> node(String label); @Override Collection<? extends DNode<String>> nodes(String label); @Override List<? extends DNode<String>> nodes(); @Override Iterable<? extends DLink<String>> links(); @Override DNode<String> add(String label); @Override Set<String> labels(); @Override boolean connected(String from, String to); @Override long state(); String toString(); void sort(); static DiskDGraph copy(Graph<String> graph, File db); @Override int hashCode(); boolean equals(Object other); @Override DNode<String> get(int i); @SuppressWarnings("unchecked") @Override Class<? extends DGraph<String>> level(); @Override List<DNode<String>> neighborsFast(Node<String> node); static DiskDGraph fromDB(File dbFile); static DiskDGraph fromFile(File file, File dir); static DiskDGraph fromFile(File file, File tmpDir, File dbFile); void close(); }
DiskDGraph implements DGraph<String>, FastWalkable<String, DNode<String>> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("digraph {"); Set<DNode<String>> nodes = new HashSet<DNode<String>>(nodes()); for(DLink<String> link : links()) { if(sb.length() != 9) sb.append("; "); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(DNode<String> node : nodes) sb.append("; " + node); sb.append("}"); return sb.toString(); } DiskDGraph(File dbFile);  DiskDGraph(File dbFile, boolean nullLabels); @Override int size(); @Override long numLinks(); @Override DNode<String> node(String label); @Override Collection<? extends DNode<String>> nodes(String label); @Override List<? extends DNode<String>> nodes(); @Override Iterable<? extends DLink<String>> links(); @Override DNode<String> add(String label); @Override Set<String> labels(); @Override boolean connected(String from, String to); @Override long state(); String toString(); void sort(); static DiskDGraph copy(Graph<String> graph, File db); @Override int hashCode(); boolean equals(Object other); @Override DNode<String> get(int i); @SuppressWarnings("unchecked") @Override Class<? extends DGraph<String>> level(); @Override List<DNode<String>> neighborsFast(Node<String> node); static DiskDGraph fromDB(File dbFile); static DiskDGraph fromFile(File file, File dir); static DiskDGraph fromFile(File file, File tmpDir, File dbFile); void close(); static final int NEIGHBOR_CAPACITY; }