本文整理汇总了Java中jdbm.htree.HTree类的典型用法代码示例。如果您正苦于以下问题:Java HTree类的具体用法?Java HTree怎么用?Java HTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HTree类属于jdbm.htree包,在下文中一共展示了HTree类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: FruitBasket
import jdbm.htree.HTree; //导入依赖的package包/类
public FruitBasket()
throws IOException
{
// create or open fruits record manager
Properties props = new Properties();
recman = RecordManagerFactory.createRecordManager( "fruits", props );
// create or load fruit basket (hashtable of fruits)
long recid = recman.getNamedObject( "basket" );
if ( recid != 0 ) {
System.out.println( "Reloading existing fruit basket..." );
hashtable = HTree.load( recman, recid );
showBasket();
} else {
System.out.println( "Creating new fruit basket..." );
hashtable = HTree.createInstance( recman );
recman.setNamedObject( "basket", hashtable.getRecid() );
}
}
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:20,代码来源:FruitBasket.java
示例2: init
import jdbm.htree.HTree; //导入依赖的package包/类
/**
* Initialize RecordManager and HTree
*/
protected void init()
throws IOException
{
recman = RecordManagerFactory.createRecordManager( jdbmName );
// create or reload HTree
long recid = recman.getNamedObject( name );
if ( recid == 0 ) {
hashtable = HTree.createInstance( recman );
recman.setNamedObject( name, hashtable.getRecid() );
} else {
hashtable = HTree.load( recman, recid );
}
}
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:19,代码来源:HashtableTest.java
示例3: loadPersistentMap
import jdbm.htree.HTree; //导入依赖的package包/类
public static HTree loadPersistentMap(RecordManager recman, String mapName) throws IOException {
long recid = recman.getNamedObject(mapName);
HTree ret;
if (recid != 0) {
ret = HTree.load(recman, recid);
} else {
ret = HTree.createInstance(recman);
recman.setNamedObject(mapName, ret.getRecid());
}
return ret;
}
开发者ID:joe42,项目名称:nubisave,代码行数:12,代码来源:FileMetaDataStore.java
注:本文中的jdbm.htree.HTree类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论