package org.psjava.ds.graph;

import org.psjava.ds.Collection;
import org.psjava.javautil.DataFilter;
import org.psjava.javautil.FilteredIterable;

public class EdgeFilteredGraph {

	public static <V, E> Graph<V, E> wrap(final Graph<V, E> original, final DataFilter<E> filter) {
		return new Graph<V, E>() {
			@Override
			public Collection<V> getVertices() {
				return original.getVertices();
			}

			@Override
			public Iterable<E> getEdges() {
				return FilteredIterable.create(original.getEdges(), filter);
			}
		};
	}

}

@@ -183,16 +183,64 @@
 ph %7B%0D%0A%0D%0A
+%09// TODO introduce SubGraph and replace this%0D%0A%0D%0A
 %09public 
@@ -579,16 +579,111 @@
 ;%0D%0A%09%09%09%7D%0D
+%0A%0D%0A%09%09%09@Override%0D%0A%09%09%09public String toString() %7B%0D%0A%09%09%09%09return GraphToString.toString(this);%0D%0A%09%09%09%7D%0D
 %0A%09%09%7D;%0D%0A%09

add debug code