FileDocCategorySizeDatePackage
RecordStoreIndex.javaAPI DocphoneME MR2 API (J2ME)17844Wed May 02 18:00:12 BST 2007com.sun.midp.rms

OffsetCache

public class OffsetCache extends IntToIntMapper
This class implements a record offset cache. It enables us to quickly find offsets for records whose IDs we know.

Fields Summary
static final int
NO_OFFSET
A special value for LastSeenOffset. There's a database header at offset 0, and 0 means we have not seen any records yet.
public int
LastSeenOffset
After this offset there's no cached record IDs. (An OffsetCache may cache offsets only for already seen records.) The value NO_OFFSET is a special value for this variable: NO_OFFSET means we have not seen any records yet.
Constructors Summary
OffsetCache(int initialCapacity, int defaultElement, int capacityIncrement)
Constructs an empty OffsetCache with the specified initial capacity and capacity increment.

param
initialCapacity the initial capacity
param
defaultElement the offset value that gets returned for record IDs that are not there
param
capacityIncrement the amount by which the capacity is increased when the mapper overflows. (0 means "to be doubled")
exception
IllegalArgumentException if the specified initial capacity is negative


                                                                                                                                                                                        
         
    
        super(initialCapacity, defaultElement, capacityIncrement);
    
Methods Summary