/** * Create a lazy children implementation. * @param factory The {@link Callable} whose <code>call()</code> method * is called just when node's children are really needed. * @return Provides lazy children implementation that can be passed * to {@link Node} constructor and thus allows the client code to decide * what children the node should have when {@link Callable#call()} is called. * @since 7.18 */ public static Children createLazy(Callable<Children> factory) { return new LazyChildren(factory); }
@Override EntrySupport entrySupport() { return getOriginal().entrySupport(); }
@Override public boolean remove(Node[] nodes) { return getOriginal().remove(nodes); }
@Override public boolean add(Node[] nodes) { return getOriginal().add(nodes); }
@Override protected void addNotify() { getOriginal().addNotify(); }
@Override protected void removeNotify() { getOriginal().removeNotify(); }
@Override public Node findChild(String name) { return getOriginal().findChild(name); }
/** Can be overridden in subclasses (probably in FilterNode) to check * whether children are of the right subclass */ void updateChildren() { Children ch = hierarchy; if (ch instanceof Children.LazyChildren) { // Replace the children with the ones provided lazily: ch = ((Children.LazyChildren) ch).getOriginal(); setChildren(ch); } }