本文整理汇总了Java中gnu.trove.map.hash.TLongLongHashMap.get方法的典型用法代码示例。如果您正苦于以下问题:Java TLongLongHashMap.get方法的具体用法?Java TLongLongHashMap.get怎么用?Java TLongLongHashMap.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.map.hash.TLongLongHashMap
的用法示例。
在下文中一共展示了TLongLongHashMap.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSaveAndLoadLongLongLut
import gnu.trove.map.hash.TLongLongHashMap; //导入方法依赖的package包/类
@Test
public void testSaveAndLoadLongLongLut()
{
H5Utils.saveLongLongLut( lut, testDirPath + testH5Name, "/lut", 4 );
final TLongLongHashMap lutMap = H5Utils.loadLongLongLut( testDirPath + testH5Name, "/lut", 2 );
final long[] keys = lutMap.keys();
System.out.println( "loaded lut: " + new Gson().toJson( lutMap ) );
for ( final long key : keys )
if ( lut.get( key ) != lutMap.get( key ) )
fail( "loaded lut key '" + key + "' does not match lut." );
}
示例2: testTroveLongLongMap
import gnu.trove.map.hash.TLongLongHashMap; //导入方法依赖的package包/类
public int testTroveLongLongMap() {
final TLongLongHashMap map = new TLongLongHashMap(initialSize, loadFactor, NULL, NULL);
int errors = 0;
for(int i = 0; i < maxSize; i++) {
map.put(i, i);
}
for(int i = 0; i < maxSize; i++) {
long x = map.get(i);
if(x!=i) {
errors++;
}
}
return errors;
//log("Done: %s, errors: %s", map.size(), errors);
}
示例3: convertTextGraphAndCreateLongMapGZ
import gnu.trove.map.hash.TLongLongHashMap; //导入方法依赖的package包/类
public static void convertTextGraphAndCreateLongMapGZ(String inputGraph, String outputGraph, String mapFile) throws IOException {
int count = 1;
TLongLongHashMap map = new TLongLongHashMap();
long time = System.currentTimeMillis();
BufferedReader br = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(inputGraph))));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(outputGraph))));
String line, newLine;
long id1, id2, tId1, tId2;
String[] parts;
while ((line = br.readLine()) != null) {
parts = line.split(SEP);
tId1 = Long.parseLong(parts[0]);
tId2 = Long.parseLong(parts[1]);
if (!map.contains(tId1)) {
map.put(tId1, count);
count++;
}
if (!map.contains(tId2)) {
map.put(tId2, count);
count++;
}
id1 = map.get(tId1);
id2 = map.get(tId2);
if (id1 != 0 && id2 != 0) {
newLine = "" + id1 + SEP + id2 + (parts.length > 2 ? (SEP + parts[2]) : "");
bw.write(newLine);
bw.newLine();
}
}
bw.flush();
bw.close();
br.close();
TxtGraphUtils.saveLongLongList(mapFile, map);
logger.info(((System.currentTimeMillis() - time) / 1000d) + "s");
}