本文整理匯總了Java中org.mapdb.DB.getTreeSet方法的典型用法代碼示例。如果您正苦於以下問題:Java DB.getTreeSet方法的具體用法?Java DB.getTreeSet怎麽用?Java DB.getTreeSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.mapdb.DB
的用法示例。
在下文中一共展示了DB.getTreeSet方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: compile
import org.mapdb.DB; //導入方法依賴的package包/類
static void compile(String file, String database){
DB db = DBMaker.newFileDB(new File(database)).compressionEnable().closeOnJvmShutdown().make();
NavigableSet<Tuple2<String, Tuple2<String,Double>>> multiset = db.getTreeSet("SW");
multiset.clear();
try {
BufferedReader swFile = new BufferedReader(new InputStreamReader(new BZip2InputStream(new FileInputStream(new File(file)), false), "UTF-8"));
int entry = 0;
for(String line=swFile.readLine();line != null;line = swFile.readLine()){
String key = line.trim();
String[] values = swFile.readLine().trim().split(" ");
for(int i = 1;i < values.length;i += 2){
multiset.add(Fun.t2(key, Fun.t2(values[i-1], Double.parseDouble(values[i]))));
}
if(entry++ > 100){
db.commit();
entry = 0;
}
}
swFile.close();
} catch (IOException e) {
e.printStackTrace();
}
db.commit();
db.close();
}
示例2: 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");
}
示例3: AssetFavoritesSet
import org.mapdb.DB; //導入方法依賴的package包/類
public AssetFavoritesSet(WalletDatabase walletDatabase, DB database)
{
this.walletDatabase = walletDatabase;
//OPEN MAP
this.assetsSet = database.getTreeSet("assetFavorites");
//CHECK IF CONTAINS QORA
if(!this.assetsSet.contains(0l))
{
this.add(0l);
}
}