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


Java TLongByteHashMap類代碼示例

本文整理匯總了Java中gnu.trove.map.hash.TLongByteHashMap的典型用法代碼示例。如果您正苦於以下問題:Java TLongByteHashMap類的具體用法?Java TLongByteHashMap怎麽用?Java TLongByteHashMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TLongByteHashMap類屬於gnu.trove.map.hash包,在下文中一共展示了TLongByteHashMap類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMultiResultCount

import gnu.trove.map.hash.TLongByteHashMap; //導入依賴的package包/類
/**
 * Get the total search weight from the multi-result hashmap.
 * 
 * @param UnigramSearchHistogram The histogram to perform the action on
 * @param word Key Hash key of the word
 * @return The total weight of the word in the multi-result map
 */
protected static int getMultiResultCount(UnigramSearchHistogram histogram, int wordKey) {
	TLongByteHashMap hashMap = histogram.multiResultMap.get(wordKey);
	int count = 0;

	if (hashMap != null) {
		for (byte resultCount : hashMap.values()) {
			count += resultCount;
		}
	}
	return count;
}
 
開發者ID:networkdowntime,項目名稱:EmbeddableSearch,代碼行數:19,代碼來源:UnigramSearchHistogram.java

示例2: removeInternal

import gnu.trove.map.hash.TLongByteHashMap; //導入依賴的package包/類
/**
 * Removes a word/result from the search histogram.  If the word is associated with multiple results, they will be left alone.
 * 
 * @param UnigramSearchHistogram The histogram to perform the action on
 * @param word Key Hash key of the word
 * @param resultKey The result to be removed.
 * @return Returns the total number of words in this histogram after removal
 */
protected static int removeInternal(UnigramSearchHistogram histogram, int wordKey, Long resultKey) {
	int count = 0;

	TLongByteHashMap hashMap = histogram.multiResultMap.get(wordKey);

	if (hashMap == null) { // not more than 1 result already
		if (histogram.singleResultMap.contains(wordKey)) { // one result
			histogram.singleResultMap.remove(wordKey); // now no results
		}
	} else { // more than 1 result already
		if (hashMap.contains(resultKey)) {
			hashMap.remove(resultKey);
		}

		count = UnigramSearchHistogram.getMultiResultCount(histogram, wordKey);

		if (count == 1) {
			histogram.singleResultMap.put(wordKey, resultKey);
			count = 1;
		}
	}

	count = UnigramSearchHistogram.getOccuranceCount(histogram, wordKey);

	if (count == 1) {
		histogram.singleResultMap.put(wordKey, resultKey); // now one result
		histogram.multiResultMap.remove(wordKey);
	}

	return histogram.singleResultMap.size() + histogram.multiResultMap.size();
}
 
開發者ID:networkdowntime,項目名稱:EmbeddableSearch,代碼行數:40,代碼來源:UnigramSearchHistogram.java

示例3: AutoDeltaLongByteMap

import gnu.trove.map.hash.TLongByteHashMap; //導入依賴的package包/類
public AutoDeltaLongByteMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TLongByteHashMap();
    this.baselineCommandCount = 0;
}
 
開發者ID:bacta,項目名稱:pre-cu,代碼行數:6,代碼來源:AutoDeltaLongByteMap.java

示例4: AutoDeltaLongBoolMap

import gnu.trove.map.hash.TLongByteHashMap; //導入依賴的package包/類
public AutoDeltaLongBoolMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TLongByteHashMap();
    this.baselineCommandCount = 0;
}
 
開發者ID:bacta,項目名稱:pre-cu,代碼行數:6,代碼來源:AutoDeltaLongBoolMap.java


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