|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.bristol.star.cdf.record.RecordMap
public class RecordMap
Keeps track of where a variable's record data is stored.
To work out the buffer and offset from which to read a record value, you can do something like this:
int ient = recMap.getEntryIndex(irec); Object value = ient >= 0 ? readBuffer(recMap.getBuf(ient), recMap.getOffset(ient,irec)) : NO_STORED_VALUE;
Method Summary | |
---|---|
static RecordMap |
createRecordMap(VariableDescriptorRecord vdr,
RecordFactory recFact,
int recSize)
Returns a record map for a given variable. |
Buf |
getBuf(int ient)
Returns the data buffer for a given entry. |
int |
getEntryCount()
Returns the number of entries managed by this map. |
int |
getEntryIndex(int irec)
Returns the index of the entry containing a given record. |
long |
getFinalOffsetInEntry(int ient)
Returns the offset of the last record in a given entry. |
long |
getOffset(int ient,
int irec)
Returns the byte offset for a record in a given entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int getEntryCount()
public int getEntryIndex(int irec)
(-fr-2)
, where fr
is the index of the previous entry.
A value of -1 indicates that the requested record is
in a sparse region before the first stored record.
If non-negative, the result can be used with the
getBuf
and getOffset
methods.
irec
- record index
irec
, or a negative
value if no entry covers itpublic Buf getBuf(int ient)
ient
- entry index
getEntryIndex(int)
public long getOffset(int ient, int irec)
ient
parameter must reference an actual entry
(it must be non-negative), and that entry must contain
the given record irec
,
ient
- entry index for entry containing irec
irec
- record index
irec
can be foundgetEntryIndex(int)
public long getFinalOffsetInEntry(int ient)
ient
- non-negative entry index
public static RecordMap createRecordMap(VariableDescriptorRecord vdr, RecordFactory recFact, int recSize) throws java.io.IOException
vdr
- variable descriptor recordrecFact
- record factoryrecSize
- size in bytes of each variable value record
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |