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 TypeMethodDescriptionvoid
clear()
copy()
void
ensureCapacity
(int capacity) entries()
int
get
(long k, int def) getObjectsSortedByValue
(boolean descending) void
incrementCount
(long k, int d) boolean
isEmpty()
keySet()
void
void
setLoadFactor
(double loadFactor) int
size()
void
toSorted()
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
-