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 /** 24 * Interface for index entries. 25 * 26 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 27 * @version $$Rev$$ 28 */ 29 public interface IndexEntry<V,O> 30 { 31 /** 32 * Gets the value referred to by this IndexEntry. 33 * 34 * @return the value of the object referred to 35 */ 36 V getValue(); 37 38 39 /** 40 * Sets the value referred to by this IndexEntry. 41 * 42 * @param value the value of the object referred to 43 */ 44 void setValue( V value ); 45 46 47 /** 48 * Gets the id of the object indexed. 49 * 50 * @return the id of the object indexed 51 */ 52 Long getId(); 53 54 55 /** 56 * Sets the id of the object indexed. 57 * 58 * @param id the id of the object indexed 59 */ 60 void setId( Long id ); 61 62 63 /** 64 * Gets the object indexed if resusitated. 65 * 66 * @return the object indexed 67 */ 68 O getObject(); 69 70 71 /** 72 * Gets access to the underlying tuple. 73 * 74 * @return the underlying tuple 75 */ 76 Tuple getTuple(); 77 78 79 /** 80 * Sets the object indexed. 81 * 82 * @param obj the object indexed 83 */ 84 void setObject( O obj ); 85 86 87 /** 88 * Clears the id, value and object in this IndexEntry. 89 */ 90 void clear(); 91 92 93 /** 94 * Copies the values of another IndexEntry into this IndexEntry. 95 * 96 * @param entry the entry to copy fields of 97 */ 98 void copy( IndexEntry<V, O> entry ); 99 }