Interface Index<Key,Value>
-
- All Known Implementing Classes:
BTreeIndex
,HashIndex
,ListIndex
,PListImpl
public interface Index<Key,Value>
Simpler than a Map
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear(Transaction tx)
clear the indexboolean
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 indexesValue
put(Transaction tx, Key key, Value entry)
store the key, itemValue
remove(Transaction tx, Key key)
remove the index keyvoid
setKeyMarshaller(Marshaller<Key> marshaller)
Set the marshaller for key objectsvoid
setValueMarshaller(Marshaller<Value> marshaller)
Set the marshaller for key objectsvoid
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
-
-