throw new IllegalArgumentException("Not Filter accepts a single filter in parameter");
}
HierarchicalGraph hgraph = (HierarchicalGraph) graph;
Filter filter = filters[0];
if (filter instanceof EdgeFilter && ((EdgeFilter) filter).init(hgraph)) {
EdgeFilter edgeFilter = (EdgeFilter) filter;
List<Edge> edgesToRemove = new ArrayList<Edge>();
for (Edge e : hgraph.getEdgesAndMetaEdges().toArray()) {
if (edgeFilter.evaluate(hgraph, e)) {
edgesToRemove.add(e);
}
}
for (Edge e : edgesToRemove) {
hgraph.removeEdge(e);
}
edgeFilter.finish();
}
return hgraph;
}