gnu.trove.map.hash.TLongByteHashMap的实例源码

项目:EmbeddableSearch    文件UnigramSearchHistogram.java   
/**
 * 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;
}
项目:EmbeddableSearch    文件UnigramSearchHistogram.java   
/**
 * 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();
}
项目:pre-cu    文件AutoDeltaLongByteMap.java   
public AutoDeltaLongByteMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TLongByteHashMap();
    this.baselineCommandCount = 0;
}
项目:pre-cu    文件AutoDeltaLongBoolMap.java   
public AutoDeltaLongBoolMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TLongByteHashMap();
    this.baselineCommandCount = 0;
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...