本文整理汇总了Java中com.sun.squawk.util.IntHashtable.remove方法的典型用法代码示例。如果您正苦于以下问题:Java IntHashtable.remove方法的具体用法?Java IntHashtable.remove怎么用?Java IntHashtable.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.util.IntHashtable
的用法示例。
在下文中一共展示了IntHashtable.remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInstallSectors
import com.sun.squawk.util.IntHashtable; //导入方法依赖的package包/类
public void testInstallSectors() {
// Setup some sectors
final int numSectors = 10;
final int size = 65536;
SimulatedNorFlashSectorAllocator.getSingleton().setupSectors(numSectors, size, INorFlashSector.RMS_PURPOSED, true);
INorFlashSector[] sectors = SimulatedNorFlashSectorAllocator.getSingleton().getInitialSectors(INorFlashSector.RMS_PURPOSED);
assertEquals(numSectors, sectors.length);
// Now uninstall them and make sure they are gone
SimulatedNorFlashSectorAllocator.getSingleton().uninstallSectors();
sectors = SimulatedNorFlashSectorAllocator.getSingleton().getInitialSectors(INorFlashSector.RMS_PURPOSED);;
assertEquals(0, sectors.length);
// Now install them and make sure they are there
SimulatedNorFlashSectorAllocator.getSingleton().installSectors(0, 0, INorFlashSector.RMS_PURPOSED);
sectors = SimulatedNorFlashSectorAllocator.getSingleton().getInitialSectors(INorFlashSector.RMS_PURPOSED);;
assertEquals(numSectors, sectors.length);
IntHashtable addresses = new IntHashtable();
Object marker = new Object();
int address = 0;
for (int i=0; i < numSectors; i++) {
addresses.put(address, marker);
address += size;
}
for (int i=0; i < numSectors; i++) {
SimulatedNorFlashSector sector = (SimulatedNorFlashSector) sectors[i];
assertEquals(size, sector.getSize());
addresses.remove(sector.getStartAddress().toUWord().toInt());
}
assertEquals(0, addresses.size());
}