Package com.db4o.internal.btree
Class BTreeNode
- java.lang.Object
-
- com.db4o.internal.Identifiable
-
- com.db4o.internal.PersistentBase
-
- com.db4o.internal.LocalPersistentBase
-
- com.db4o.internal.btree.BTreeNode
-
- All Implemented Interfaces:
LinkLengthAware
,Persistent
public final class BTreeNode extends LocalPersistentBase
We work with BTreeNode in two states: - deactivated: never read, no valid members, ID correct or 0 if new - write: real representation of keys, values and children in arrays The write state can be detected with canWrite(). States can be changed as needed with prepareRead() and prepareWrite().
-
-
Field Summary
-
Fields inherited from class com.db4o.internal.Identifiable
_id, _state
-
-
Method Summary
-
Methods inherited from class com.db4o.internal.LocalPersistentBase
readBufferById
-
Methods inherited from class com.db4o.internal.PersistentBase
linkLength, newWriteBuffer, produceReadBuffer, produceWriteBuffer, read, read, write, writeOwnID
-
Methods inherited from class com.db4o.internal.Identifiable
beginProcessing, endProcessing, getID, isActive, isDirty, isNew, setID, setStateClean, setStateDeactivated, setStateDirty
-
-
-
-
Constructor Detail
-
BTreeNode
public BTreeNode(BTree btree, int count, boolean isLeaf, int parentID, int previousID, int nextID)
-
BTreeNode
public BTreeNode(int id, BTree btree)
-
BTreeNode
public BTreeNode(Transaction trans, BTreeNode firstChild, BTreeNode secondChild)
-
-
Method Detail
-
btree
public BTree btree()
-
add
public BTreeNode add(Transaction trans, PreparedComparison preparedComparison, java.lang.Object obj)
- Returns:
- the split node if this node is split or this if the first key has changed
-
canWrite
public boolean canWrite()
-
commit
public void commit(Transaction trans)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classIdentifiable
-
free
public void free(LocalTransaction trans)
- Overrides:
free
in classPersistentBase
-
count
public int count()
-
firstKeyIndex
public int firstKeyIndex(Transaction trans)
-
lastKeyIndex
public int lastKeyIndex(Transaction trans)
-
indexIsValid
public boolean indexIsValid(Transaction trans, int index)
-
getIdentifier
public byte getIdentifier()
-
key
public java.lang.Object key(Transaction trans, int index)
-
ownLength
public int ownLength()
-
readThis
public void readThis(Transaction trans, ByteArrayBuffer reader)
-
remove
public void remove(Transaction trans, int index)
-
remove
public boolean remove(Transaction trans, java.lang.Object obj, int index)
-
remove
public void remove(Transaction trans, PreparedComparison preparedComparison, java.lang.Object obj, int index)
-
previousNode
public BTreeNode previousNode()
-
nextNode
public BTreeNode nextNode()
-
lastPointer
public BTreePointer lastPointer(Transaction trans)
-
purge
public void purge()
-
traverseKeys
public void traverseKeys(Transaction trans, Visitor4 visitor)
-
writeObjectBegin
public boolean writeObjectBegin()
- Overrides:
writeObjectBegin
in classPersistentBase
-
writeThis
public void writeThis(Transaction trans, ByteArrayBuffer buffer)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
debugLoadFully
public void debugLoadFully(Transaction trans)
-
defragIndex
public static void defragIndex(DefragmentContextImpl context, Indexable4 keyHandler)
-
isLeaf
public boolean isLeaf()
-
size
public int size(Transaction trans)
-
slotChangeFactory
public SlotChangeFactory slotChangeFactory()
- Overrides:
slotChangeFactory
in classPersistentBase
-
idSystem
public TransactionalIdSystem idSystem(Transaction trans)
- Overrides:
idSystem
in classLocalPersistentBase
-
toReadMode
public void toReadMode()
-
-