當前位置: 首頁>>代碼示例>>Java>>正文


Java TIntObjectHashMap.iterator方法代碼示例

本文整理匯總了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();
	}
	
}
 
開發者ID:sisinflab,項目名稱:lodreclib,代碼行數:34,代碼來源:TextFileUtils.java

示例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();
	}
	
}
 
開發者ID:sisinflab,項目名稱:lodreclib,代碼行數:34,代碼來源:TextFileUtils.java

示例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();
  }
}
 
開發者ID:iamxiatian,項目名稱:wikit,代碼行數:11,代碼來源:MIntInt2ObjectMap.java

示例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();
	}
	
}
 
開發者ID:sisinflab,項目名稱:lodreclib,代碼行數:34,代碼來源:TextFileUtils.java


注:本文中的gnu.trove.map.hash.TIntObjectHashMap.iterator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。