1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.server.xdbm; 21 22 23 import org.apache.directory.server.core.cursor.Cursor; 24 25 26 /** 27 * A Cursor introducing new advance methods designed to reduce some 28 * inefficiencies encountered when scanning over Tuples. 29 * 30 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 31 * @version $Rev$ 32 */ 33 public interface IndexCursor<V,E> extends Cursor<IndexEntry<V,E>> 34 { 35 /** 36 * An alternative to calling before(IndexEntry) which often may require 37 * wrapping an id and value in a newly created IndexEntry object that may 38 * be an unnecessary object creation. Some implementations may not 39 * support this operation and may throw an UnsupportedOperationEception. 40 * 41 * @param id the Long id for the entry 42 * @param indexValue the value to advance just before 43 * @throws Exception if there are faults peforming this operation 44 */ 45 void beforeValue( Long id, V indexValue ) throws Exception; 46 47 48 /** 49 * An alternative to calling after(IndexEntry) which often may require 50 * wrapping an id and value in a newly created IndexEntry object that may 51 * be an unnecessary object creation. Some implementations may not 52 * support this operation and may throw an UnsupportedOperationEception. 53 * 54 * @param id the Long id for the entry 55 * @param indexValue the value to advance just after the last value 56 * @throws Exception if there are faults peforming this operation 57 */ 58 void afterValue( Long id, V indexValue ) throws Exception; 59 }