@Override public void removeVisitor(Visitor visitor) { super.removeVisitor(visitor); if (visitor instanceof ReducedGraphVisitor) { visitors.remove(visitor); } }
@Override public void addVisitor(Visitor visitor) { if (visitor instanceof ReducedGraphVisitor) { super.addVisitor(visitor); visitors.add((ReducedGraphVisitor) visitor); } else { throw new IllegalArgumentException( "This visitor composition is only compatible with implementations of " + ReducedGraphVisitor.class.getSimpleName() + "."); } }
@Override public void clearVisitors() { super.clearVisitors(); visitors.clear(); }