|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.objectwave.persist.file.RecordHeader
| Nested Class Summary | |
static class |
RecordHeader.Test
Unit tests. |
| Method Summary | |
static RecordHeader |
create(java.io.RandomAccessFile file)
Create instances from the RandomAccessFile |
long |
getBytesToNextRecord()
|
byte[] |
getData(java.io.RandomAccessFile file)
Get the data from the file. |
java.lang.String |
getPrimaryKey()
The pkey read from the record, or null if this record is not valid. |
static RecordHeader |
insert(java.lang.String primaryKeyField,
java.io.RandomAccessFile file,
byte[] data)
Write a new record the random access file. |
void |
invalidate(java.io.RandomAccessFile file)
|
boolean |
isValid()
|
void |
setPrimaryKey(java.lang.String value)
|
void |
skip(java.io.RandomAccessFile file)
Move the FilePointer by the appropriate amount to skip this record. |
void |
update(java.io.RandomAccessFile file,
byte[] data)
A 'db' update. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static RecordHeader create(java.io.RandomAccessFile file)
throws java.io.IOException
file - RandomAccessFile The file upon which to write.
java.io.IOException
public static RecordHeader insert(java.lang.String primaryKeyField,
java.io.RandomAccessFile file,
byte[] data)
throws java.io.IOException
primaryKeyField - Some string value that will uniquely identify this row.file - RandomAccessFile The file upon which to write.data - byte [] The data from the persistent object.
java.io.IOExceptionpublic void setPrimaryKey(java.lang.String value)
value - The new PrimaryKey value
public byte[] getData(java.io.RandomAccessFile file)
throws java.io.IOException
file - RandomAccessFile The file upon which to get the data.
java.io.IOExceptionpublic boolean isValid()
public java.lang.String getPrimaryKey()
public long getBytesToNextRecord()
public void skip(java.io.RandomAccessFile file)
throws java.io.IOException
file - RandomAccessFile The file upon which to skip.
java.io.IOException
public void update(java.io.RandomAccessFile file,
byte[] data)
throws java.io.EOFException,
java.io.IOException
file - RandomAccessFile The file upon which to write.data -
java.io.EOFException - - If trying to write more data than is allowed in the current record.
java.io.IOException
public void invalidate(java.io.RandomAccessFile file)
throws java.io.IOException
file - RandomAccessFile The file upon which to write.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||