001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 package org.apache.directory.server.xdbm; 021 022 023 /** 024 * Interface for index entries. 025 * 026 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 027 * @version $$Rev$$ 028 */ 029 public interface IndexEntry<V, O, ID> 030 { 031 /** 032 * Gets the value referred to by this IndexEntry. 033 * 034 * @return the value of the object referred to 035 */ 036 V getValue(); 037 038 039 /** 040 * Sets the value referred to by this IndexEntry. 041 * 042 * @param value the value of the object referred to 043 */ 044 void setValue( V value ); 045 046 047 /** 048 * Gets the id of the object indexed. 049 * 050 * @return the id of the object indexed 051 */ 052 ID getId(); 053 054 055 /** 056 * Sets the id of the object indexed. 057 * 058 * @param id the id of the object indexed 059 */ 060 void setId( ID id ); 061 062 063 /** 064 * Gets the object indexed if resusitated. 065 * 066 * @return the object indexed 067 */ 068 O getObject(); 069 070 071 /** 072 * Gets access to the underlying tuple. 073 * 074 * @return the underlying tuple 075 */ 076 Tuple<?, ?> getTuple(); 077 078 079 /** 080 * Sets the object indexed. 081 * 082 * @param obj the object indexed 083 */ 084 void setObject( O obj ); 085 086 087 /** 088 * Clears the id, value and object in this IndexEntry. 089 */ 090 void clear(); 091 092 093 /** 094 * Copies the values of another IndexEntry into this IndexEntry. 095 * 096 * @param entry the entry to copy fields of 097 */ 098 void copy( IndexEntry<V, O, ID> entry ); 099 }