Package org.eclipse.jgit.util
Class LongMap<V>
- java.lang.Object
-
- org.eclipse.jgit.util.LongMap<V>
-
- Type Parameters:
V- type of the value instance.
public class LongMap<V> extends java.lang.ObjectSimple Map<long, Object>.- Since:
- 4.9
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classLongMap.Node<V>
-
Field Summary
Fields Modifier and Type Field Description private intgrowAtprivate static floatLOAD_FACTORprivate intsizeNumber of entries currently in the map.private LongMap.Node<V>[]table
-
Constructor Summary
Constructors Constructor Description LongMap()Initialize an empty LongMap.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(long key)Whetherkeyis present in the map.private static <V> LongMap.Node<V>[]createArray(int sz)Vget(long key)Get value for thiskeyprivate voidgrow()private intindex(long key)private voidinsert(LongMap.Node<V> n)Vput(long key, V value)Put a new entry into the mapVremove(long key)Remove an entry from the map
-
-
-
Field Detail
-
LOAD_FACTOR
private static final float LOAD_FACTOR
- See Also:
- Constant Field Values
-
table
private LongMap.Node<V>[] table
-
size
private int size
Number of entries currently in the map.
-
growAt
private int growAt
-
-
Method Detail
-
containsKey
public boolean containsKey(long key)
Whetherkeyis present in the map.- Parameters:
key- the key to find.- Returns:
trueifkeyis present in the map.
-
get
public V get(long key)
Get value for thiskey- Parameters:
key- the key to find.- Returns:
- stored value for this key, or
null.
-
remove
public V remove(long key)
Remove an entry from the map- Parameters:
key- key to remove from the map.- Returns:
- old value of the key, or
null.
-
put
public V put(long key, V value)
Put a new entry into the map- Parameters:
key- key to storevalueunder.value- new value.- Returns:
- prior value, or null.
-
insert
private void insert(LongMap.Node<V> n)
-
grow
private void grow()
-
index
private final int index(long key)
-
createArray
private static final <V> LongMap.Node<V>[] createArray(int sz)
-
-