本文整理汇总了Java中gnu.trove.map.hash.TIntObjectHashMap.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java TIntObjectHashMap.iterator方法的具体用法?Java TIntObjectHashMap.iterator怎么用?Java TIntObjectHashMap.iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.map.hash.TIntObjectHashMap
的用法示例。
在下文中一共展示了TIntObjectHashMap.iterator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeTIntMapTIntHashSet
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
public static void writeTIntMapTIntHashSet(String file, TIntObjectHashMap<TIntHashSet> map){
try{
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
TIntObjectIterator<TIntHashSet> it = map.iterator();
StringBuffer str;
while(it.hasNext()){
str = new StringBuffer();
it.advance();
str.append(it.key() + "\t");
TIntHashSet tmp = it.value();
TIntIterator it1 = tmp.iterator();
while(it1.hasNext())
str.append(it1.next() + ",");
writer.append(str.substring(0, str.length()-1));
writer.newLine();
}
writer.flush();
writer.close();
}
catch(Exception e){
e.printStackTrace();
}
}
示例2: writeData
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
public static void writeData(String file, TIntObjectHashMap<TIntObjectHashMap<TIntIntHashMap>> path){
BufferedWriter writer;
try {
writer = new BufferedWriter(new FileWriter(file));
TIntObjectIterator<TIntObjectHashMap<TIntIntHashMap>> it = path.iterator();
while(it.hasNext()){
it.advance();
int a = it.key();
TIntObjectHashMap<TIntIntHashMap> tmp = it.value();
if(tmp!=null){
TIntObjectIterator<TIntIntHashMap> it1 = tmp.iterator();
while(it1.hasNext()){
it1.advance();
int b = it1.key();
writer.append(a + "-" + b + ": " + it1.value());
writer.newLine();
}
}
}
writer.flush();
writer.close();
}
catch (Exception e){
e.printStackTrace();
}
}
示例3: curry
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
/** Returns an iterator over the set of (key2, value) pairs that match (key1). */
public TIntObjectIterator curry (int key1)
{
final TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
if (inner == null) {
return new TIntObjectHashMap().iterator();
} else {
return inner.iterator();
}
}
示例4: writeTIntMapArrayString
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
public static void writeTIntMapArrayString(String file, TIntObjectHashMap<ArrayList<String>> map){
try{
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
TIntObjectIterator<ArrayList<String>> it = map.iterator();
StringBuffer str;
while(it.hasNext()){
str = new StringBuffer();
it.advance();
str.append(it.key() + "\t");
ArrayList<String> tmp = it.value();
for(String s : tmp)
str.append(s + ",");
writer.append(str.substring(0, str.length()-1));
writer.newLine();
}
writer.flush();
writer.close();
}
catch(Exception e){
e.printStackTrace();
}
}