@NotStorableClass public class HeapHeader extends AbstractFileStorable
Modifier and Type | Field and Description |
---|---|
static int |
HEAP_HEADER_SIZE
size of the header in heap file
8 for freeRootNodeFilePosition 8 for idRootNodeFilePosition 8 for lastRecordPositionInFile 8 for endOfRecordPositionInFile 8 for usedSize 8 for freeSize 8 for next data record identifier 4 for crc32 |
fileForStorable, justCreated, logger, numberOfByteReadWrote, positionInFile, valueChangedToSave
Constructor and Description |
---|
HeapHeader(IHeapElementManager heapElementManager)
construct header for reading in heap file or for an empty heap
|
Modifier and Type | Method and Description |
---|---|
void |
addFreeSize(int newFreeAreaSize)
when an area is freed add to free and substract from used
|
void |
addUsedSize(int newUsedAreaSize)
when a new used area is addes when add to used
|
void |
clear()
initial state:no value to save since not read and not write
|
boolean |
equals(Object obj) |
long |
getEndOfRecordPositionInFile()
end of record position in file, , the position of byte after last record
|
long |
getFreeRootNodeFilePosition() |
long |
getFreeSize() |
long |
getIdRootNodeFilePosition() |
long |
getLastRecordPositionInFile() |
long |
getNextDataRecordIdentifier() |
long |
getPreviousRecordPositionInFile() |
int |
getRecordSize()
get the record size
|
long |
getUsedSize() |
protected void |
marshallImpl()
marshaling implementation for write
#crc32 is set to zero |
void |
setEndOfRecordPositionInFile(long endOfRecordPositionInFile) |
void |
setFreeRootNodeFilePosition(long freeRootNodeFilePosition) |
void |
setIdRootNodeFilePosition(long idRootNodeFilePosition) |
void |
setLastRecordPositionInFile(long lastRecordPositionInFile) |
void |
setNextDataRecordIdentifier(DataRecordIdentifier nextDataRecordIdentifier) |
void |
setNextDataRecordIdentifier(long value) |
protected int |
toMarshallSize() |
String |
toString() |
void |
unfreeSize(int areaSize)
when area is unfreed add to used and substract from free
|
protected void |
unmarshallImpl()
Unmarshalling implementation for read
#crc32 is set to zero |
protected void |
valueChangedAction() |
getPositionInFile, hashCode, isJustCreated, isValueChangedToSave, readAndCheckCrc32, readBoolean, readByte, readBytes, readBytes, readFileAppendToIoBuffer, readFileToIoBuffer, readFromFile, readInteger, readLong, setValueIsChangedValueToSave, setValueIsNotChanged, writeBoolean, writeByte, writeBytes, writeCrc32, writeInteger, writeLong, writeToFile, writeToFileGetWrited
public static final int HEAP_HEADER_SIZE
public HeapHeader(IHeapElementManager heapElementManager)
public long getPreviousRecordPositionInFile() throws HeapException
HeapException
public int getRecordSize() throws HeapException
IFileStorable
HeapException
protected void valueChangedAction() throws HeapException
valueChangedAction
in class AbstractFileStorable
HeapException
public void setFreeRootNodeFilePosition(long freeRootNodeFilePosition) throws HeapException
HeapException
public long getFreeRootNodeFilePosition()
public void setIdRootNodeFilePosition(long idRootNodeFilePosition) throws HeapException
HeapException
public long getIdRootNodeFilePosition()
public long getLastRecordPositionInFile()
public void setLastRecordPositionInFile(long lastRecordPositionInFile) throws HeapException
HeapException
public long getEndOfRecordPositionInFile()
public void setEndOfRecordPositionInFile(long endOfRecordPositionInFile) throws HeapException
HeapException
public long getNextDataRecordIdentifier()
public void setNextDataRecordIdentifier(DataRecordIdentifier nextDataRecordIdentifier) throws HeapException
HeapException
public void setNextDataRecordIdentifier(long value) throws HeapException
HeapException
protected int toMarshallSize()
toMarshallSize
in class AbstractFileStorable
protected void marshallImpl() throws HeapException
AbstractFileStorable
#crc32
is set to zeromarshallImpl
in class AbstractFileStorable
HeapException
protected void unmarshallImpl() throws HeapException
AbstractFileStorable
#crc32
is set to zerounmarshallImpl
in class AbstractFileStorable
HeapException
public void addUsedSize(int newUsedAreaSize) throws HeapException
newUsedAreaSize
- to add used area sizeHeapException
public void unfreeSize(int areaSize) throws HeapException
areaSize
- to add to used size and substract to free sizeHeapException
public void addFreeSize(int newFreeAreaSize) throws HeapException
newFreeAreaSize
- to substract to used size and add to free sizeHeapException
public long getFreeSize()
public long getUsedSize()
public void clear()
IFileStorable
clear
in interface IFileStorable
clear
in class AbstractFileStorable
public String toString()
toString
in class AbstractFileStorable
public boolean equals(Object obj)
equals
in class AbstractFileStorable
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.