com.sun.squawk.rms
Class RecordStoreEntry
java.lang.Object
com.sun.squawk.rms.RmsEntry
com.sun.squawk.rms.RecordStoreEntry
- All Implemented Interfaces:
- IRecordStoreEntry, IRmsEntry
public class RecordStoreEntry
- extends RmsEntry
- implements IRecordStoreEntry
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
INSERT_PADDING
protected static final int INSERT_PADDING
- See Also:
- Constant Field Values
manager
protected IRecordStoreManager manager
id
protected int id
recordIds
protected int[] recordIds
recordAddresses
protected Address[] recordAddresses
name
protected String name
numRecords
protected int numRecords
lastRecordId
protected int lastRecordId
lastModifiedTimestamp
protected long lastModifiedTimestamp
version
protected int version
RecordStoreEntry
public RecordStoreEntry(IRecordStoreManager manager)
absorbTempEntry
public void absorbTempEntry(IRecordStoreEntry tempEntry)
- Specified by:
absorbTempEntry in interface IRecordStoreEntry
addRecord
public int addRecord(byte[] bytes,
int offset,
int length)
throws RecordStoreException,
RecordStoreFullException
- Specified by:
addRecord in interface IRecordStoreEntry
- Throws:
RecordStoreException
RecordStoreFullException
changed
protected void changed()
deleteRecord
public void deleteRecord(int recordId)
throws InvalidRecordIDException,
RecordStoreException
- Specified by:
deleteRecord in interface IRecordStoreEntry
- Throws:
InvalidRecordIDException
RecordStoreException
deleteRecords
public void deleteRecords()
throws RecordStoreException
- Specified by:
deleteRecords in interface IRecordStoreEntry
- Throws:
RecordStoreException
findRecordAddress
protected Address findRecordAddress(int recordId)
throws InvalidRecordIDException,
RecordStoreException
- Throws:
InvalidRecordIDException
RecordStoreException
findRecordIndex
protected int findRecordIndex(int recordId)
- Returns:
- index of the search key, if it is contained in the list;
otherwise, (-(insertion point) - 1). The
insertion point is defined as the point at which the
key would be inserted into the list: the index of the first
element greater than the key, or list.size(), if all
elements in the list are less than the specified key. Note
that this guarantees that the return value will be >= 0 if
and only if the key is found.
findRecord
protected IRecordEntry findRecord(int recordId)
throws InvalidRecordIDException,
RecordStoreException
- Throws:
InvalidRecordIDException
RecordStoreException
getId
public int getId()
- Specified by:
getId in interface IRecordStoreEntry
getName
public String getName()
- Specified by:
getName in interface IRecordStoreEntry
getNextRecordId
public int getNextRecordId()
- Specified by:
getNextRecordId in interface IRecordStoreEntry
getNumRecords
public int getNumRecords()
- Specified by:
getNumRecords in interface IRecordStoreEntry
getRecord
public byte[] getRecord(int recordId)
throws InvalidRecordIDException,
RecordStoreException
- Specified by:
getRecord in interface IRecordStoreEntry
- Throws:
InvalidRecordIDException
RecordStoreException
getRecord
public int getRecord(int recordId,
byte[] buffer,
int offset)
throws InvalidRecordIDException,
RecordStoreException
- Specified by:
getRecord in interface IRecordStoreEntry
- Throws:
InvalidRecordIDException
RecordStoreException
getRecordIdsCopy
public int[] getRecordIdsCopy()
- Specified by:
getRecordIdsCopy in interface IRecordStoreEntry
getRecordSize
public int getRecordSize(int recordId)
throws InvalidRecordIDException,
RecordStoreException
- Specified by:
getRecordSize in interface IRecordStoreEntry
- Throws:
InvalidRecordIDException
RecordStoreException
getRecordsSize
public int getRecordsSize()
throws RecordStoreException
- Specified by:
getRecordsSize in interface IRecordStoreEntry
- Throws:
RecordStoreException
getTimestamp
public long getTimestamp()
- Specified by:
getTimestamp in interface IRecordStoreEntry
getType
public int getType()
- Specified by:
getType in interface IRmsEntry
getVersion
public int getVersion()
- Specified by:
getVersion in interface IRecordStoreEntry
insertAtIndex
protected void insertAtIndex(int index)
readFrom
public void readFrom(IMemoryHeapBlock memoryBlock)
throws IOException
- Specified by:
readFrom in interface IRmsEntry- Overrides:
readFrom in class RmsEntry
- Throws:
IOException
reVisitRecordEntry
public void reVisitRecordEntry(IRecordEntry record)
throws RecordStoreException
- Specified by:
reVisitRecordEntry in interface IRecordStoreEntry
- Throws:
RecordStoreException
setId
public void setId(int id)
- Specified by:
setId in interface IRecordStoreEntry
setName
public void setName(String name)
- Specified by:
setName in interface IRecordStoreEntry
setRecord
public void setRecord(int recordId,
byte[] bytes,
int offset,
int length)
throws InvalidRecordIDException,
RecordStoreException,
RecordStoreFullException
- Specified by:
setRecord in interface IRecordStoreEntry
- Throws:
InvalidRecordIDException
RecordStoreException
RecordStoreFullException
visit
public void visit(IRmsEntryVisitor visitor)
throws RecordStoreException
- Specified by:
visit in interface IRmsEntry
- Throws:
RecordStoreException
visitRecordEntry
public void visitRecordEntry(IRecordEntry record)
throws RecordStoreException
- Specified by:
visitRecordEntry in interface IRecordStoreEntry
- Throws:
RecordStoreException
writeTo
public void writeTo(DataOutputStream dataOut)
throws IOException
- Specified by:
writeTo in interface IRmsEntry- Overrides:
writeTo in class RmsEntry
- Throws:
IOException
"For updated information see the Java FRC site"