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