当前位置: 首页>>代码示例>>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;未经允许,请勿转载。