当前位置: 首页>>代码示例>>Java>>正文


Java DB.getTreeMap方法代码示例

本文整理汇总了Java中org.mapdb.DB.getTreeMap方法的典型用法代码示例。如果您正苦于以下问题:Java DB.getTreeMap方法的具体用法?Java DB.getTreeMap怎么用?Java DB.getTreeMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mapdb.DB的用法示例。


在下文中一共展示了DB.getTreeMap方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LocalitySensitiveHashing

import org.mapdb.DB; //导入方法依赖的package包/类
public LocalitySensitiveHashing(File file, int numFunctions , int numBands, Map<String,Integer> featureWeights ) {
 if ( numFunctions % numBands != 0 ) throw new Error("Number of hash functions is not divisible by the number of bands.");
    try {
 	   DB db = DBMaker.newFileDB(file).closeOnJvmShutdown().make();
      this.featureWeights = featureWeights;
   this.function = MinHash.createHashFunctions(MinHash.HashType.POLYNOMIAL,numFunctions);
      this.representation = db.getTreeMap("representation");
   this.value = db.getTreeMap("value");
   this.validity = db.getTreeMap("kvalue");
   this.index = (Map[]) Array.newInstance(db.getTreeMap("index").getClass(),numBands);	 
   this.indexTemp = (Map[]) Array.newInstance(new HashMap<Integer,Set<Integer>>().getClass(),numBands);	 
   for ( int i = 0 ; i < numBands ; i++ ) {
	   this.indexTemp[i] = new HashMap<Integer,Set<Integer>>();
	   this.index[i] = db.getTreeMap("index-"+i);
   }
	 } catch ( Exception ex ) { ex.printStackTrace(); throw new Error(ex); } 
}
 
开发者ID:davidsbatista,项目名称:MuSICo,代码行数:18,代码来源:LocalitySensitiveHashing.java

示例2: test

import org.mapdb.DB; //导入方法依赖的package包/类
/**
     * 测试provider注册
     */
    public void test(DB db) {

        
                //create new collection (or open existing)
                ConcurrentNavigableMap map = db.getTreeMap("collectionName");
                map.put(1,"one");
                map.put(new Random().nextInt(25500),"bnt_test" + new Random().nextInt(25005));
                //persist changes into disk, there is also rollback() method
                db.commit();
//                db.close();
                cnt.incrementAndGet();
    }
 
开发者ID:tiglabs,项目名称:jsf-core,代码行数:16,代码来源:TestMapDB.java

示例3: GTFSFeed

import org.mapdb.DB; //导入方法依赖的package包/类
private GTFSFeed (DB db) {
    this.db = db;

    agency = db.getTreeMap("agency");
    feedInfo = db.getTreeMap("feed_info");
    routes = db.getTreeMap("routes");
    trips = db.getTreeMap("trips");
    stop_times = db.getTreeMap("stop_times");
    frequencies = db.getTreeSet("frequencies");
    transfers = db.getTreeMap("transfers");
    stops = db.getTreeMap("stops");
    fares = db.getTreeMap("fares");
    services = db.getTreeMap("services");
    shape_points = db.getTreeMap("shape_points");

    feedId = db.getAtomicString("feed_id").get();
    checksum = db.getAtomicLong("checksum").get();

    // use Java serialization because MapDB serialization is very slow with JTS as they have a lot of references.
    // nothing else contains JTS objects
    patterns = db.createTreeMap("patterns")
            .valueSerializer(Serializer.JAVA)
            .makeOrGet();

    tripPatternMap = db.getTreeMap("patternForTrip");

    stopCountByStopTime = db.getTreeMap("stopCountByStopTime");
    stopStopTimeSet = db.getTreeSet("stopStopTimeSet");
    tripsPerService = db.getTreeSet("tripsPerService");
    servicesPerDate = db.getTreeSet("servicesPerDate");

    errors = db.getTreeSet("errors");
}
 
开发者ID:conveyal,项目名称:gtfs-lib,代码行数:34,代码来源:GTFSFeed.java

示例4: Core

import org.mapdb.DB; //导入方法依赖的package包/类
public Core(DB db) {
    
    
    
    
    this.db = db;
    // open existing an collection (or create new)
    data = db.getTreeMap("objects");
    session = db.getTreeMap("session");

    if (session.get(Session_MYSELF)==null) {            
        //first time user
        become(newUser("Anonymous " + NObject.UUID().substring(0,4)));
    }
    
    
    //    map.put(1, "one");
    //    map.put(2, "two");
    //    // map.keySet() is now [1,2]
    //
    //    db.commit();  //persist changes into disk
    //
    //    map.put(3, "three");
    //    // map.keySet() is now [1,2,3]
    //    db.rollback(); //revert recent changes
    //    // map.keySet() is now [1,2]
    //
    //    db.close();
}
 
开发者ID:automenta,项目名称:netentionj-desktop,代码行数:30,代码来源:Core.java

示例5: SubscriptionImpl

import org.mapdb.DB; //导入方法依赖的package包/类
@Inject
public SubscriptionImpl(DB db)
{
    projectSubscriptionMap = db.<String, List<String>> getTreeMap("ProjectSubscription");
    userSubscriptionMap = db.<String, List<String>> getTreeMap("UserSubscription");
}
 
开发者ID:Ullink,项目名称:slack4gerrit,代码行数:7,代码来源:SubscriptionImpl.java

示例6: ReviewRequestServiceImpl

import org.mapdb.DB; //导入方法依赖的package包/类
@Inject
public ReviewRequestServiceImpl(DB db)
{
    reviewRequestMap = db.<String, List<ReviewRequest>> getTreeMap("ReviewRequests");
}
 
开发者ID:Ullink,项目名称:slack4gerrit,代码行数:6,代码来源:ReviewRequestServiceImpl.java

示例7: getMap

import org.mapdb.DB; //导入方法依赖的package包/类
@Override
protected Map<String, byte[]> getMap(DB database) 
{
	//OPEN MAP
	return database.getTreeMap("references");
}
 
开发者ID:razakal,项目名称:Qora,代码行数:7,代码来源:ReferenceMap.java

示例8: AccountMap

import org.mapdb.DB; //导入方法依赖的package包/类
public AccountMap(WalletDatabase walletDatabase, DB database) 
{
	//OPEN MAP
	this.addressMap = database.getTreeMap(ADDRESSES);
}
 
开发者ID:razakal,项目名称:Qora,代码行数:6,代码来源:AccountMap.java


注:本文中的org.mapdb.DB.getTreeMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。