BTreeIndex implements SortedIndex<Key, Value> { public void visit(IndexVisitor<Key, Value> visitor) { root().visit(this, visitor); } BTreeIndex(Paged paged, int page, BTreeIndexFactory<Key, Value> factory); @Override String toString(); void create(); boolean containsKey(Key key); Value get(Key key); Value put(Key key, Value value); Value putIfAbsent(Key key, Value value); Value remove(Key key); int size(); boolean isEmpty(); void clear(); int getMinLeafDepth(); int getMaxLeafDepth(); void printStructure(PrintWriter out); void printStructure(OutputStream out); Iterator<Map.Entry<Key, Value>> iterator(); Iterator<Map.Entry<Key, Value>> iterator(Predicate<Key> predicate); Iterator<Map.Entry<Key, Value>> iterator(final Key initialKey); void visit(IndexVisitor<Key, Value> visitor); Map.Entry<Key, Value> getFirst(); Map.Entry<Key, Value> getLast(); Paged getPaged(); int getIndexLocation(); Codec<Key> getKeyMarshaller(); Codec<Value> getValueMarshaller(); Prefixer<Key> getPrefixer(); Comparator getComparator(); void destroy();  }
@Test public void testVisitor() throws Exception { createPageFileAndIndex((short)100); BTreeIndex<String,Long> index = ((BTreeIndex<String,Long>)this.index); doInsert(1000); reloadIndex(); tx.commit(); index.visit(new IndexVisitor<String, Long>(){ public boolean isInterestedInKeysBetween(String first, String second, Comparator comparator) { return true; } public void visit(List<String> strings, List<Long> longs, Comparator comparator) { } public boolean isSatiated() { return false; } }); }