public abstract class AbstractDataAccess extends Object implements DataAccess
| Modifier and Type | Field and Description |
|---|---|
protected BitUtil |
bitUtil |
protected ByteOrder |
byteOrder |
protected boolean |
closed |
protected static byte[] |
EMPTY |
protected int[] |
header |
protected static int |
HEADER_OFFSET |
protected int |
indexDivisor |
protected String |
name |
protected static int |
SEGMENT_SIZE_MIN |
protected int |
segmentSizeInBytes |
protected int |
segmentSizePower |
| Constructor and Description |
|---|
AbstractDataAccess(String name,
String location,
int segmentSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method makes sure that the underlying used resources are released.
|
protected void |
copyHeader(DataAccess da) |
protected String |
getFullName() |
int |
getHeader(int bytePos)
Get 4 bytes from the header at 'index'
|
String |
getName()
The logical identification of this object.
|
int |
getSegmentSize() |
boolean |
isClosed() |
protected boolean |
isIntBased() |
boolean |
isStoring() |
protected long |
readHeader(RandomAccessFile raFile) |
void |
setHeader(int bytePos,
int value)
Set 4 bytes at the header space index to the specified value
|
String |
toString() |
protected void |
writeHeader(RandomAccessFile file,
long length,
int segmentSize)
Writes some internal data into the beginning of the specified file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreate, ensureCapacity, flush, getByte, getBytes, getCapacity, getInt, getSegments, getShort, getType, loadExisting, setByte, setBytes, setInt, setShortprotected static final int SEGMENT_SIZE_MIN
protected static final int HEADER_OFFSET
protected static final byte[] EMPTY
protected final ByteOrder byteOrder
protected final BitUtil bitUtil
protected int[] header
protected String name
protected int segmentSizeInBytes
protected int segmentSizePower
protected int indexDivisor
protected boolean closed
public String getName()
DataAccessgetName in interface DataAccessprotected String getFullName()
public void close()
DataAccessclose in interface DataAccessclose in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
isClosed in interface DataAccesspublic void setHeader(int bytePos,
int value)
DataAccesssetHeader in interface DataAccesspublic int getHeader(int bytePos)
DataAccessgetHeader in interface DataAccessprotected void writeHeader(RandomAccessFile file, long length, int segmentSize) throws IOException
IOExceptionprotected long readHeader(RandomAccessFile raFile) throws IOException
IOExceptionprotected void copyHeader(DataAccess da)
public int getSegmentSize()
getSegmentSize in interface DataAccesspublic boolean isStoring()
protected boolean isIntBased()
Copyright © 2012–2022. All rights reserved.