@Test public void testLinks() { DTGraph<String,String> graph = new LightDTGraph<String,String>(); DTNode<String,String> a = graph.add(null), b = graph.add(null), c = graph.add(null); a.connect(b, null); a.connect(c, null); a.connect(c, null); assertEquals(0, a.links(a).size()); assertEquals(1, a.links(b).size()); assertEquals(1, b.links(a).size()); assertEquals(2, a.links(c).size()); assertEquals(2, c.links(a).size()); }
@Override public Iterable<? extends DTLink<L, T>> links() { return new LinkCollection(); }
LightDTGraph implements DTGraph<L, T> { @Override public Iterable<? extends DTLink<L, T>> links() { return new LinkCollection(); } }
LightDTGraph implements DTGraph<L, T> { @Override public Iterable<? extends DTLink<L, T>> links() { return new LinkCollection(); } LightDTGraph();  LightDTGraph(int capacity); }
LightDTGraph implements DTGraph<L, T> { @Override public Iterable<? extends DTLink<L, T>> links() { return new LinkCollection(); } LightDTGraph();  LightDTGraph(int capacity); @Override Set<T> tags(); @Override int size(); @Override DTNode<L, T> node(L label); @Override Collection<? extends DTNode<L, T>> nodes(L label); @Override List<? extends DTNode<L, T>> nodes(); @Override DTNode<L, T> get(int i); @Override Iterable<? extends DTLink<L, T>> links(); @Override DTNode<L, T> add(L label); @Override long numLinks(); @Override Set<L> labels(); @Override boolean connected(L from, L to); @Override long state(); @SuppressWarnings("unchecked") @Override Class<? extends DTGraph<L, T>> level(); boolean equals(Object other); String toString(); }
LightDTGraph implements DTGraph<L, T> { @Override public Iterable<? extends DTLink<L, T>> links() { return new LinkCollection(); } LightDTGraph();  LightDTGraph(int capacity); @Override Set<T> tags(); @Override int size(); @Override DTNode<L, T> node(L label); @Override Collection<? extends DTNode<L, T>> nodes(L label); @Override List<? extends DTNode<L, T>> nodes(); @Override DTNode<L, T> get(int i); @Override Iterable<? extends DTLink<L, T>> links(); @Override DTNode<L, T> add(L label); @Override long numLinks(); @Override Set<L> labels(); @Override boolean connected(L from, L to); @Override long state(); @SuppressWarnings("unchecked") @Override Class<? extends DTGraph<L, T>> level(); boolean equals(Object other); String toString(); static final int NEIGHBOR_CAPACITY; }