private static void list(PathChildrenCache cache) { if (cache.getCurrentData().size() == 0) { System.out.println("* empty *"); } else { for (ChildData data : cache.getCurrentData()) { System.out.println(data.getPath() + " = " + new String(data.getData())); } } }
/** * Construct a ChildPathIterator. * * @param converter converter from node data to domain object * @param cache source for children nodes */ public ChildPathIterator(Converter<ChildData, T> converter, PathChildrenCache cache) { Assert.notNull(converter); Assert.notNull(cache); this.converter = converter; List<ChildData> list = cache.getCurrentData(); this.iterator = list == null ? Collections.<ChildData>emptyIterator() : list.iterator(); }