|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgr.uoa.di.madgik.grs.store.record.FileRecordStore
public class FileRecordStore
Implementation of the IRecordStore
using a RandomAccessFile
over a local file as the persistency medium
Constructor Summary | |
---|---|
FileRecordStore()
Creates a new instance |
Method Summary | |
---|---|
void |
dispose()
Disposes the IRecordStore instance as well as any permanent storage resources occupied |
void |
enableOrder(boolean enableOrder)
Whether the IRecordStore.retrieveByIndex(long, boolean) operation should be enabled or not |
long |
getRecordCount()
Retrieves the number of Record s stored using this IRecordStore |
void |
persist(Record record)
Persists the provided Record |
Record |
retrieve(long recordID,
boolean reset)
Retrieves a previously stored Record based on its id |
Record |
retrieveByIndex(long recordIndex,
boolean reset)
Retrieve a previously stored Record based on the index by which it was stored. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileRecordStore() throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void enableOrder(boolean enableOrder)
IRecordStore.retrieveByIndex(long, boolean)
operation should be enabled or not
enableOrder
in interface IRecordStore
enableOrder
- whether the IRecordStore.retrieveByIndex(long, boolean)
operation should be enabled or notIRecordStore.enableOrder(boolean)
public long getRecordCount()
Record
s stored using this IRecordStore
getRecordCount
in interface IRecordStore
Record
s storedIRecordStore.getRecordCount()
public void dispose() throws GRS2RecordStoreException
IRecordStore
instance as well as any permanent storage resources occupied
dispose
in interface IRecordStore
GRS2RecordStoreException
- the state of the IRecordStore
does not allow for this operation to be completedIRecordStore.dispose()
public void persist(Record record) throws GRS2RecordStoreException
Record
persist
in interface IRecordStore
record
- the Record
to persist
GRS2RecordStoreException
- the state of the IRecordStore
does not allow for this operation to be completedIRecordStore.persist(gr.uoa.di.madgik.grs.record.Record)
public Record retrieve(long recordID, boolean reset) throws GRS2RecordStoreException
Record
based on its id
retrieve
in interface IRecordStore
recordID
- the ID of the Record
to be retrievedreset
- whether during the Record.inflate(java.io.DataInput, boolean)
invocation
the reset parameter should be set to true or false
Record
retrieved
GRS2RecordStoreException
- the state of the IRecordStore
does not allow for this operation to be completedIRecordStore.retrieve(long, boolean)
public Record retrieveByIndex(long recordIndex, boolean reset) throws GRS2RecordStoreException
Record
based on the index by which it was stored. This method is only
available if before the first time a IRecordStore.persist(Record)
was invoked the method
IRecordStore.enableOrder(boolean)
has been set to true
retrieveByIndex
in interface IRecordStore
recordIndex
- The index by which the Record
to be retrieved was storedreset
- whether during the Record.inflate(java.io.DataInput, boolean)
invocation
the reset parameter should be set to true or false
Record
retrieved
GRS2RecordStoreException
- the state of the IRecordStore
does not allow for this operation to be completedIRecordStore.retrieveByIndex(long, boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |