當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。