Top Description Inners Fields Constructors Methods
org.eclipse.jgit.util

public Class LongMap<V>

extends Object
Class Inheritance
Type Parameters
<V>
type of the value instance.

Simple Map<long, Object>.
Since
4.9

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
growAt

Next size to trigger a grow().

private static final float
private int
size

Number of entries currently in the map.

private LongMap.Node<V>[]

Constructor Summary

AccessConstructor and Description
public
LongMap()

Initialize an empty LongMap.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if key is present in the map.
containsKey
(long
the key to find.
key
)

Whether key is present in the map.

private static final <V> LongMap.Node<V>[]
createArray(int sz)

public V

Returns:

stored value for this key, or null.
get
(long
the key to find.
key
)

Get value for this key

private void
grow()

private final int
index(long key)

private void
public V

Returns:

prior value, or null.
put
(long
key to store value under.
key
,
V
new value.
value
)

Put a new entry into the map

public V

Returns:

old value of the key, or null.
remove
(long
key to remove from the map.
key
)

Remove an entry from the map

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

growAtback to summary
private int growAt

Next size to trigger a grow().

LOAD_FACTORback to summary
private static final float LOAD_FACTOR
sizeback to summary
private int size

Number of entries currently in the map.

tableback to summary
private LongMap.Node<V>[] table

Constructor Detail

LongMapback to summary
public LongMap()

Initialize an empty LongMap.

Method Detail

containsKeyback to summary
public boolean containsKey(long key)

Whether key is present in the map.

Parameters
key:long

the key to find.

Returns:boolean

true if key is present in the map.

createArrayback to summary
private static final <V> LongMap.Node<V>[] createArray(int sz)
Annotations
@SuppressWarnings:unchecked
getback to summary
public V get(long key)

Get value for this key

Parameters
key:long

the key to find.

Returns:V

stored value for this key, or null.

growback to summary
private void grow()
indexback to summary
private final int index(long key)
insertback to summary
private void insert(LongMap.Node<V> n)
putback to summary
public V put(long key, V value)

Put a new entry into the map

Parameters
key:long

key to store value under.

value:V

new value.

Returns:V

prior value, or null.

removeback to summary
public V remove(long key)

Remove an entry from the map

Parameters
key:long

key to remove from the map.

Returns:V

old value of the key, or null.

org.eclipse.jgit.util back to summary

private Class LongMap.Node<V>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final long
pack-priv LongMap.Node<V>
pack-priv V

Constructor Summary

AccessConstructor and Description
pack-priv
Node(long k, V v)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
pack-priv final long key
nextback to summary
pack-priv LongMap.Node<V> next
valueback to summary
pack-priv V value

Constructor Detail

Nodeback to summary
pack-priv Node(long k, V v)