|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.kahadb.index.ListIndex<Key,Value>
public class ListIndex<Key,Value>
| Field Summary | |
|---|---|
protected long |
headPageId
|
protected java.util.concurrent.atomic.AtomicBoolean |
loaded
|
static long |
NOT_SET
|
protected PageFile |
pageFile
|
protected long |
tailPageId
|
| Constructor Summary | |
|---|---|
ListIndex()
|
|
ListIndex(PageFile pageFile,
long headPageId)
|
|
ListIndex(PageFile pageFile,
Page page)
|
|
| Method Summary | |
|---|---|
Value |
add(Transaction tx,
Key key,
Value value)
|
Value |
addFirst(Transaction tx,
Key key,
Value value)
|
void |
clear(Transaction tx)
clear the index |
boolean |
containsKey(Transaction tx,
Key key)
|
ListNode<Key,Value> |
createNode(Transaction tx)
|
Value |
get(Transaction tx,
Key key)
|
java.util.Map.Entry<Key,Value> |
getFirst(Transaction tx)
|
protected ListNode<Key,Value> |
getHead(Transaction tx)
|
long |
getHeadPageId()
|
Marshaller<Key> |
getKeyMarshaller()
|
java.util.Map.Entry<Key,Value> |
getLast(Transaction tx)
|
PageFile |
getPageFile()
|
protected ListNode<Key,Value> |
getTail(Transaction tx)
|
long |
getTailPageId()
|
Marshaller<Value> |
getValueMarshaller()
|
boolean |
isEmpty(Transaction tx)
|
boolean |
isTransient()
|
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx)
|
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx,
long initialPosition)
|
java.util.Iterator<ListNode<Key,Value>> |
listNodeIterator(Transaction tx)
|
void |
load(Transaction tx)
load indexes |
void |
onRemove()
|
Value |
put(Transaction tx,
Key key,
Value value)
Update the value of the item with the given key in the list if ot exists, otherwise it appends the value to the end of the list. |
Value |
remove(Transaction tx,
Key key)
remove the index key |
void |
setHeadPageId(long headPageId)
|
void |
setKeyMarshaller(Marshaller<Key> keyMarshaller)
Set the marshaller for key objects |
void |
setPageFile(PageFile pageFile)
|
void |
setTailPageId(long tailPageId)
|
void |
setValueMarshaller(Marshaller<Value> valueMarshaller)
Set the marshaller for key objects |
long |
size()
|
void |
storeNode(Transaction tx,
ListNode<Key,Value> node,
boolean overflow)
|
void |
unload(Transaction tx)
unload indexes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long NOT_SET
protected PageFile pageFile
protected long headPageId
protected long tailPageId
protected java.util.concurrent.atomic.AtomicBoolean loaded
| Constructor Detail |
|---|
public ListIndex()
public ListIndex(PageFile pageFile,
long headPageId)
public ListIndex(PageFile pageFile,
Page page)
| Method Detail |
|---|
public void load(Transaction tx)
throws java.io.IOException
Index
load in interface Index<Key,Value>java.io.IOExceptionpublic void unload(Transaction tx)
Index
unload in interface Index<Key,Value>
protected ListNode<Key,Value> getHead(Transaction tx)
throws java.io.IOException
java.io.IOException
protected ListNode<Key,Value> getTail(Transaction tx)
throws java.io.IOException
java.io.IOException
public boolean containsKey(Transaction tx,
Key key)
throws java.io.IOException
containsKey in interface Index<Key,Value>java.io.IOException
public Value get(Transaction tx,
Key key)
throws java.io.IOException
get in interface Index<Key,Value>java.io.IOException
public Value put(Transaction tx,
Key key,
Value value)
throws java.io.IOException
put in interface Index<Key,Value>java.io.IOException
public Value add(Transaction tx,
Key key,
Value value)
throws java.io.IOException
java.io.IOException
public Value addFirst(Transaction tx,
Key key,
Value value)
throws java.io.IOException
java.io.IOException
public Value remove(Transaction tx,
Key key)
throws java.io.IOException
Index
remove in interface Index<Key,Value>java.io.IOExceptionpublic void onRemove()
public boolean isTransient()
isTransient in interface Index<Key,Value>
public void clear(Transaction tx)
throws java.io.IOException
Index
clear in interface Index<Key,Value>java.io.IOException
public java.util.Iterator<ListNode<Key,Value>> listNodeIterator(Transaction tx)
throws java.io.IOException
java.io.IOException
public boolean isEmpty(Transaction tx)
throws java.io.IOException
java.io.IOException
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx)
throws java.io.IOException
iterator in interface Index<Key,Value>java.io.IOException
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx,
long initialPosition)
throws java.io.IOException
java.io.IOException
public java.util.Map.Entry<Key,Value> getFirst(Transaction tx)
throws java.io.IOException
java.io.IOException
public java.util.Map.Entry<Key,Value> getLast(Transaction tx)
throws java.io.IOException
java.io.IOException
public ListNode<Key,Value> createNode(Transaction tx)
throws java.io.IOException
java.io.IOException
public void storeNode(Transaction tx,
ListNode<Key,Value> node,
boolean overflow)
throws java.io.IOException
java.io.IOExceptionpublic PageFile getPageFile()
public void setPageFile(PageFile pageFile)
public long getHeadPageId()
public void setHeadPageId(long headPageId)
public Marshaller<Key> getKeyMarshaller()
public void setKeyMarshaller(Marshaller<Key> keyMarshaller)
Index
setKeyMarshaller in interface Index<Key,Value>public Marshaller<Value> getValueMarshaller()
public void setValueMarshaller(Marshaller<Value> valueMarshaller)
Index
setValueMarshaller in interface Index<Key,Value>public void setTailPageId(long tailPageId)
public long getTailPageId()
public long size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||