本文整理匯總了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();
}
}