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

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

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()
           
 Iterator<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 IOException
load indexes

Throws:
IOException

unload

void unload(Transaction tx)
            throws IOException
unload indexes

Throws:
IOException

clear

void clear(Transaction tx)
           throws IOException
clear the index

Throws:
IOException

containsKey

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

remove

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

Parameters:
key -
Returns:
StoreEntry removed
Throws:
IOException

put

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

Parameters:
key -
entry -
Throws:
IOException

get

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

isTransient

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

iterator

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


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.