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.
Simple Map<long, Object>.
- Since:
- 4.9
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final float
private int
Number of entries currently in the map.private LongMap.Node<V>[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(long key) Whetherkey
is present in the map.private static final <V> LongMap.Node<V>[]
createArray
(int sz) get
(long key) Get value for thiskey
private void
grow()
private final int
index
(long key) private void
insert
(LongMap.Node<V> n) Put a new entry into the mapremove
(long key) Remove an entry from the map
-
Field Details
-
LOAD_FACTOR
private static final float LOAD_FACTOR- See Also:
-
table
-
size
private int sizeNumber of entries currently in the map. -
growAt
private int growAt
-
-
Constructor Details
-
LongMap
public LongMap()Initialize an empty LongMap.
-
-
Method Details
-
containsKey
public boolean containsKey(long key) Whetherkey
is present in the map.- Parameters:
key
- the key to find.- Returns:
true
ifkey
is present in the map.
-
get
Get value for thiskey
- Parameters:
key
- the key to find.- Returns:
- stored value for this key, or
null
.
-
remove
Remove an entry from the map- Parameters:
key
- key to remove from the map.- Returns:
- old value of the key, or
null
.
-
put
Put a new entry into the map- Parameters:
key
- key to storevalue
under.value
- new value.- Returns:
- prior value, or null.
-
insert
-
grow
private void grow() -
index
private final int index(long key) -
createArray
-