com.sun.squawk.flash
Class NorFlashMemoryHeap
java.lang.Object
   com.sun.squawk.flash.NorFlashMemoryHeap
com.sun.squawk.flash.NorFlashMemoryHeap
- All Implemented Interfaces: 
- INorFlashMemoryHeap
- public class NorFlashMemoryHeap 
- extends Object- implements INorFlashMemoryHeap
 
 
 
 
ERASED_VALUE
public static final byte ERASED_VALUE
- See Also:
- Constant Field Values
ERASED_VALUE_XOR
public static final byte ERASED_VALUE_XOR
- See Also:
- Constant Field Values
BLOCK_HEADER_SIZE
public static final int BLOCK_HEADER_SIZE
- See Also:
- Constant Field Values
BLOCK_FOOTER
public static final byte[] BLOCK_FOOTER
sectorStates
protected INorFlashSectorState[] sectorStates
currentSectorState
protected INorFlashSectorState currentSectorState
erasedSequenceCurrentValue
protected int erasedSequenceCurrentValue
inUseSectorStateList
protected INorFlashSectorStateList inUseSectorStateList
toBeErasedSectorStateList
protected INorFlashSectorStateList toBeErasedSectorStateList
hasScannedBlocks
protected boolean hasScannedBlocks
NorFlashMemoryHeap
protected NorFlashMemoryHeap()
NorFlashMemoryHeap
public NorFlashMemoryHeap(INorFlashSectorState[] sectorStates)
NorFlashMemoryHeap
public NorFlashMemoryHeap(int purpose)
- Parameters:
- purpose- One of INorFlashMemorySector.USER_PURPOSED
- Throws:
- IOException
getNorFlashSectors
public static Vector getNorFlashSectors(int purpose)
- 
 
- 
- Returns:
- SquawkVector
 
forceEraseAll
public void forceEraseAll()
- 
- Specified by:
- forceEraseAllin interface- INorFlashMemoryHeap
 
- 
 
freeBlockAt
public void freeBlockAt(Address address)
                 throws RecordStoreException
- 
- Specified by:
- freeBlockAtin interface- INorFlashMemoryHeap
 
- 
- Throws:
- RecordStoreException
 
getBlockAt
public IMemoryHeapBlock getBlockAt(Address address)
                            throws RecordStoreException
- 
- Specified by:
- getBlockAtin interface- INorFlashMemoryHeap
 
- 
- Throws:
- RecordStoreException
 
getBlockAt
protected boolean getBlockAt(IMemoryHeapBlock block,
                             INorFlashSectorState sectorState,
                             int offset)
                      throws RecordStoreException
- 
 
- 
- Parameters:
- block-
- sectorState-
- offset-
- Returns:
- boolean true if there was a block at that address, false if not
- Throws:
- RecordStoreException
 
getErasedSequenceCurrentValue
public long getErasedSequenceCurrentValue()
- 
- Specified by:
- getErasedSequenceCurrentValuein interface- INorFlashMemoryHeap
 
- 
 
getSectorContaining
public INorFlashSectorState getSectorContaining(Address address)
- 
 
- 
 
getSizeAvailable
public int getSizeAvailable()
                     throws RecordStoreException
- 
- Specified by:
- getSizeAvailablein interface- INorFlashMemoryHeap
 
- 
- Throws:
- RecordStoreException
 
incrementErasedSequence
public int incrementErasedSequence()
- 
 
- 
 
init
protected void init(INorFlashSectorState[] sectorStates)
- 
 
- 
 
makeRoomToWrite
protected void makeRoomToWrite(int entrySize,
                               INorFlashMemoryHeapScanner scanner)
                        throws RecordStoreException
- 
 
- 
- Throws:
- RecordStoreException
 
allocateAndWriteBlock
public Address allocateAndWriteBlock(byte[] bytes,
                                     int offset,
                                     int length,
                                     INorFlashMemoryHeapScanner scanner)
                              throws RecordStoreException
- 
- Specified by:
- allocateAndWriteBlockin interface- INorFlashMemoryHeap
 
- 
- Throws:
- RecordStoreException
 
scanBlocks
public void scanBlocks(INorFlashMemoryHeapScanner scanner)
                throws RecordStoreException
- It is guaranteed that the order that blocks were allocated in, is the order in which they will be iterated.
 
- 
- Specified by:
- scanBlocksin interface- INorFlashMemoryHeap
 
- 
- Parameters:
- scanner-
- Throws:
- RecordStoreException
 
writeBlock
protected Address writeBlock(IMemoryHeapBlock block,
                             INorFlashMemoryHeapScanner scanner,
                             Address oldAddress)
                      throws RecordStoreException
- 
 
- 
- Throws:
- RecordStoreException
 
"For updated information see the Java FRC site"