public <A, T extends VoidVisitor<A>> void addVoidListener( Filter2<Object, T, A> filter, In3<T, Node, A> listener) { final VoidFactory was = voidFactory; voidFactory = (vis, arg) -> { if (filter.filter(vis, arg)) { return (In3) listener; } return was.io(vis, arg); }; }
public <A, Vis extends VoidVisitor<A>> In3<Vis, Node, A> voidVisit(Vis vis, A arg) { final In3 factory = voidFactory.io(vis, arg); return (v, n, a) -> { try (Do undo = universalListener.io(n, a)) { factory.in(v, n, a); } }; }