public class DiskBuffer extends Object
| Modifier and Type | Field and Description |
|---|---|
long |
rtime
Time it took to read
|
long |
wtime
Time it took to write
|
| Constructor and Description |
|---|
DiskBuffer(String filename,
boolean flag)
Creates a new
DiskBuffer |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the underlying structs
|
void |
close()
Closes the underlying file stream
|
FilePosition |
persist(gr.uoa.di.madgik.grs.record.Record rec)
Persists the provided record
|
gr.uoa.di.madgik.grs.record.Record |
retrieve(FilePosition pos)
Retrieves the record from the given position
|
Vector<gr.uoa.di.madgik.grs.record.Record> |
retrieve(Vector<FilePosition> pos)
Retrieves the records in teh given possitions
|
public long wtime
public long rtime
public DiskBuffer(String filename, boolean flag) throws Exception
DiskBufferfilename - The name of the file to useflag - iftrue The file is opened for writing, otherwise for readingException - An unrecoverable for the operation error occuredpublic FilePosition persist(gr.uoa.di.madgik.grs.record.Record rec) throws Exception
rec - The record to persistException - An unrecoverable for the operation error occuredpublic void close()
throws Exception
Exception - An unrecoverable for the operation error occuredpublic Vector<gr.uoa.di.madgik.grs.record.Record> retrieve(Vector<FilePosition> pos) throws Exception
pos - Teh possition to read fromException - An unrecoverable for the operation error occuredpublic gr.uoa.di.madgik.grs.record.Record retrieve(FilePosition pos) throws Exception
pos - The position to retrieve the record fromException - An unrecoverable for the operation error occuredpublic void clear()
Copyright © 2017. All Rights Reserved.