public interface DataAccess extends Storable<DataAccess>
Life cycle: (1) object creation, (2) configuration (e.g. segment size), (3) create or loadExisting, (4) usage and calling ensureCapacity if necessary, (5) close
Modifier and Type | Method and Description |
---|---|
DataAccess |
copyTo(DataAccess da)
Copies the content from this object into the specified one.
|
DataAccess |
create(long bytes)
The first time you use a DataAccess object after configuring it you need to call this method.
|
boolean |
ensureCapacity(long bytes)
Ensures that the capacity of this object is at least the specified bytes.
|
void |
getBytes(long bytePos,
byte[] values,
int length)
Get bytes from position 'index'
|
int |
getHeader(int bytePos)
Get 4 bytes from the header at 'index'
|
int |
getInt(long bytePos)
Get 4 bytes from position 'bytePos'
|
String |
getName()
The logical identification of this object.
|
int |
getSegments() |
int |
getSegmentSize() |
short |
getShort(long bytePos)
Get 2 bytes from position 'index'
|
DAType |
getType() |
void |
rename(String newName)
Renames the underlying DataAccess object.
|
void |
setBytes(long bytePos,
byte[] values,
int length)
Set bytes from position 'index' to the specified values
|
void |
setHeader(int bytePos,
int value)
Set 4 bytes at the header space index to the specified value
|
void |
setInt(long bytePos,
int value)
Set 4 bytes at position 'bytePos' to the specified value
|
DataAccess |
setSegmentSize(int bytes)
In order to increase allocated space one needs to layout the underlying storage in segments.
|
void |
setShort(long bytePos,
short value)
Set 2 bytes at position 'index' to the specified value
|
void |
trimTo(long bytes)
Reduces the allocate space to the specified bytes.
|
close, flush, getCapacity, isClosed, loadExisting
String getName()
void rename(String newName)
IllegalStateException
- if a rename is not possiblevoid setInt(long bytePos, int value)
int getInt(long bytePos)
void setShort(long bytePos, short value)
short getShort(long bytePos)
void setBytes(long bytePos, byte[] values, int length)
void getBytes(long bytePos, byte[] values, int length)
values
- acts as outputvoid setHeader(int bytePos, int value)
int getHeader(int bytePos)
DataAccess create(long bytes)
create
in interface Storable<DataAccess>
boolean ensureCapacity(long bytes)
create(long)
void trimTo(long bytes)
DataAccess copyTo(DataAccess da)
int getSegmentSize()
DataAccess setSegmentSize(int bytes)
int getSegments()
DAType getType()
Copyright © 2012–2018. All rights reserved.