Package edu.berkeley.nlp.lm.collections
Class LongToIntHashMap
java.lang.Object
edu.berkeley.nlp.lm.collections.LongToIntHashMap
Open address hash map with linear probing. Assumes keys are non-negative
(uses -1 internally for empty key). Returns 0.0 for keys not in the map.
- Author:
- adampauls
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()copy()voidensureCapacity(int capacity) entries()intget(long k, int def) getObjectsSortedByValue(boolean descending) voidincrementCount(long k, int d) booleanisEmpty()keySet()voidvoidsetLoadFactor(double loadFactor) intsize()voidtoSorted()toString()
-
Constructor Details
-
LongToIntHashMap
public LongToIntHashMap() -
LongToIntHashMap
public LongToIntHashMap(int initCapacity_)
-
-
Method Details
-
setLoadFactor
public void setLoadFactor(double loadFactor) -
toString
-
toSorted
public void toSorted() -
put
-
incrementCount
public void incrementCount(long k, int d) -
get
public int get(long k, int def) -
isEmpty
public boolean isEmpty() -
entries
-
ensureCapacity
public void ensureCapacity(int capacity) -
size
public int size() -
primitiveEntries
-
keySet
-
clear
public void clear() -
getObjectsSortedByValue
-
copy
-