org.apache.kahadb.index
Interface Index<Key,Value>

All Known Implementing Classes:
BTreeIndex, HashIndex, ListIndex, PList

public interface Index<Key,Value>

Simpler than a Map


Method Summary
 void clear(Transaction tx)
          clear the index
 boolean containsKey(Transaction tx, Key key)
           
 Value get(Transaction tx, Key key)
           
 boolean isTransient()
           
 java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx)
           
 void load(Transaction tx)
          load indexes
 Value put(Transaction tx, Key key, Value entry)
          store the key, item
 Value remove(Transaction tx, Key key)
          remove the index key
 void setKeyMarshaller(Marshaller<Key> marshaller)
          Set the marshaller for key objects
 void setValueMarshaller(Marshaller<Value> marshaller)
          Set the marshaller for key objects
 void unload(Transaction tx)
          unload indexes
 

Method Detail

setKeyMarshaller

void setKeyMarshaller(Marshaller<Key> marshaller)
Set the marshaller for key objects

Parameters:
marshaller -

setValueMarshaller

void setValueMarshaller(Marshaller<Value> marshaller)
Set the marshaller for key objects

Parameters:
marshaller -

load

void load(Transaction tx)
          throws java.io.IOException
load indexes

Throws:
java.io.IOException

unload

void unload(Transaction tx)
            throws java.io.IOException
unload indexes

Throws:
java.io.IOException

clear

void clear(Transaction tx)
           throws java.io.IOException
clear the index

Throws:
java.io.IOException

containsKey

boolean containsKey(Transaction tx,
                    Key key)
                    throws java.io.IOException
Parameters:
key -
Returns:
true if it contains the key
Throws:
java.io.IOException

remove

Value remove(Transaction tx,
             Key key)
             throws java.io.IOException
remove the index key

Parameters:
key -
Returns:
StoreEntry removed
Throws:
java.io.IOException

put

Value put(Transaction tx,
          Key key,
          Value entry)
          throws java.io.IOException
store the key, item

Parameters:
key -
entry -
Throws:
java.io.IOException

get

Value get(Transaction tx,
          Key key)
          throws java.io.IOException
Parameters:
key -
Returns:
the entry
Throws:
java.io.IOException

isTransient

boolean isTransient()
Returns:
true if the index is transient

iterator

java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx)
                                                            throws java.io.IOException,
                                                                   java.lang.UnsupportedOperationException
Parameters:
tx -
Returns:
Throws:
java.io.IOException
java.lang.UnsupportedOperationException


Copyright © 2005-2015. All Rights Reserved.