@NotStorableClass public class NonTerminalPage extends AbstractNodePage implements INonTerminalPage
Modifier and Type | Field and Description |
---|---|
static int |
HEAD_TAIL_SIZE |
static int |
MAX_NUMBER_OF_ENTRIES |
longKey
Constructor and Description |
---|
NonTerminalPage(int numberOfKeyEntries,
boolean longKey)
not static set creation
|
NonTerminalPage(int numberOfKeyEntries,
DataRecordIdentifier[] keys,
long[] pagePosition,
boolean longKey) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ILeafPage existingLeftILeafPage,
ILeafPage newRightILeafPage) |
boolean |
add(INonTerminalPage leftSonNonTerminalPage,
DataRecordIdentifier middleKey,
INonTerminalPage rightSonNonTerminalPage) |
boolean |
checkKeys()
for assertion
|
DataRecordIdentifier |
getAndClearMiddleKey()
get and clear middle key computed by
split() |
int |
getByteSize() |
DataRecordIdentifier |
getFirstKey() |
int |
getIndex(DataRecordIdentifier dataRecordIdentifier) |
int |
getInParentIndex() |
DataRecordIdentifier |
getKey(int index) |
DataRecordIdentifier |
getLastKey() |
long |
getLastPagePosition() |
int |
getNumberOfKeyEntries() |
int |
getNumberOfPage()
the number of pages take is fix
|
long |
getPagePointer(int index) |
IPageRecordable |
getParentPage() |
EnumRecordType |
getRecordType() |
void |
remove(int leafPageInParentIndex) |
void |
setEntry(int index,
long pagePointer,
DataRecordIdentifier key) |
boolean |
setKey(int index,
DataRecordIdentifier key)
change key
|
void |
setParentPage(IPageRecordable parentPage,
int inParentIndex) |
INonTerminalPage |
split() |
int |
tryBalanceOrMerge(DataRecordIdentifier middleKey,
NonTerminalPage rightNonTerminalPage)
update
this#middleKey if do not merge |
void |
updateByteSize() |
void |
updateByteSizeAcceptBigger() |
boolean |
wellFilled() |
entrySize
getPageRecord, getPositionInFile, getPreviousRecordPositionInFile, setPageRecord, setValueIsChangedValueToSave, setValueIsNotChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPositionInFile
getPageRecord, setPageRecord
setValueIsChangedValueToSave, setValueIsNotChanged
public static final int HEAD_TAIL_SIZE
public static final int MAX_NUMBER_OF_ENTRIES
public NonTerminalPage(int numberOfKeyEntries, boolean longKey)
numberOfKeyEntries
- longKey
- @Fortest public NonTerminalPage(int numberOfKeyEntries, DataRecordIdentifier[] keys, long[] pagePosition, boolean longKey) throws HeapException
HeapException
public EnumRecordType getRecordType()
getRecordType
in interface IPageRecordable
public int getNumberOfPage()
IPageRecordable
getNumberOfPage
in interface IPageRecordable
public void setParentPage(IPageRecordable parentPage, int inParentIndex)
setParentPage
in interface IPageRecordable
public IPageRecordable getParentPage()
getParentPage
in interface IPageRecordable
public int getInParentIndex() throws HeapException
getInParentIndex
in interface INonTerminalPage
getInParentIndex
in interface IPageRecordable
HeapException
public void setEntry(int index, long pagePointer, DataRecordIdentifier key) throws HeapException
HeapException
public boolean setKey(int index, DataRecordIdentifier key) throws HeapException
index
- key
- HeapException
public int getByteSize()
getByteSize
in interface IPageRecordable
public final void updateByteSize() throws HeapException
updateByteSize
in interface IPageRecordable
HeapException
@Fortest public void updateByteSizeAcceptBigger() throws HeapException
HeapException
public int getNumberOfKeyEntries()
getNumberOfKeyEntries
in interface INonTerminalPage
public long getPagePointer(int index)
getPagePointer
in interface INonTerminalPage
public DataRecordIdentifier getKey(int index)
getKey
in interface INonTerminalPage
public int getIndex(DataRecordIdentifier dataRecordIdentifier)
dataRecordIdentifier
- public boolean add(ILeafPage existingLeftILeafPage, ILeafPage newRightILeafPage) throws HeapException
existingLeftILeafPage
- newRightILeafPage
- HeapException
public boolean add(INonTerminalPage leftSonNonTerminalPage, DataRecordIdentifier middleKey, INonTerminalPage rightSonNonTerminalPage) throws HeapException
leftSonNonTerminalPage
- middleKey
- rightSonNonTerminalPage
- HeapException
public INonTerminalPage split() throws HeapException
HeapException
public DataRecordIdentifier getAndClearMiddleKey()
split()
split()
public void remove(int leafPageInParentIndex)
public boolean wellFilled()
public int tryBalanceOrMerge(DataRecordIdentifier middleKey, NonTerminalPage rightNonTerminalPage) throws HeapException
this#middleKey
if do not mergemiddleKey
- rightNonTerminalPage
- HeapException
public DataRecordIdentifier getLastKey()
getLastKey
in class AbstractNodePage
public long getLastPagePosition()
public DataRecordIdentifier getFirstKey()
public final boolean checkKeys()
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.