Class MetaData
- java.lang.Object
-
- eu.svjatoslav.sixth.data.store.file.MetaData
-
public class MetaData extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intFILE_LOCATION_ENTRY_ALLOCATION_TABLE_START
-
Constructor Summary
Constructors Constructor Description MetaData(FileDataStore dataStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longallocateStorageSpace(int amountOfBytes)voiddecreaseUsedEntriesCount()voidensureMinimumCurrentLocation(long minimumLocation)booleanentriesTableNeedsIncreasing()longgetEntriesStorageAreaStart()longgetEntriesStorageAreaStart(int hypotheticalEntriesTableSize)intgetEntriesTableSize()intgetNewEntryId()voidincreaseUsedEntriesCount()voidinitializeNewFile()voidreadFileHeader()voidsetCurrentLocation(long currentLocation)voidsetEntriesTableSize(int newSize)voidwriteFileHeader()
-
-
-
Field Detail
-
FILE_LOCATION_ENTRY_ALLOCATION_TABLE_START
public static final int FILE_LOCATION_ENTRY_ALLOCATION_TABLE_START
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MetaData
public MetaData(FileDataStore dataStore)
-
-
Method Detail
-
allocateStorageSpace
public long allocateStorageSpace(int amountOfBytes)
- Returns:
- address of the start of the allocated space
-
decreaseUsedEntriesCount
public void decreaseUsedEntriesCount()
-
ensureMinimumCurrentLocation
public void ensureMinimumCurrentLocation(long minimumLocation)
-
entriesTableNeedsIncreasing
public boolean entriesTableNeedsIncreasing()
-
getEntriesStorageAreaStart
public long getEntriesStorageAreaStart()
-
getEntriesStorageAreaStart
public long getEntriesStorageAreaStart(int hypotheticalEntriesTableSize)
-
getEntriesTableSize
public int getEntriesTableSize()
- Returns:
- amount of entries in the entries table
-
setEntriesTableSize
public void setEntriesTableSize(int newSize)
-
getNewEntryId
public int getNewEntryId()
-
increaseUsedEntriesCount
public void increaseUsedEntriesCount()
-
initializeNewFile
public void initializeNewFile() throws IOException- Throws:
IOException
-
readFileHeader
public void readFileHeader() throws IOException- Throws:
IOException
-
setCurrentLocation
public void setCurrentLocation(long currentLocation)
-
writeFileHeader
public void writeFileHeader() throws IOException- Throws:
IOException
-
-