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 int
FILE_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 long
allocateStorageSpace(int amountOfBytes)
void
decreaseUsedEntriesCount()
void
ensureMinimumCurrentLocation(long minimumLocation)
boolean
entriesTableNeedsIncreasing()
long
getEntriesStorageAreaStart()
long
getEntriesStorageAreaStart(int hypotheticalEntriesTableSize)
int
getEntriesTableSize()
int
getNewEntryId()
void
increaseUsedEntriesCount()
void
initializeNewFile()
void
readFileHeader()
void
setCurrentLocation(long currentLocation)
void
setEntriesTableSize(int newSize)
void
writeFileHeader()
-
-
-
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
-
-