public class PrimitiveLongIntKeyValueArray extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_GROWTH_FACTOR |
static int |
DEFAULT_INITIAL_CAPACITY |
| Constructor and Description |
|---|
PrimitiveLongIntKeyValueArray() |
PrimitiveLongIntKeyValueArray(int initialCapacity) |
PrimitiveLongIntKeyValueArray(int initialCapacity,
double growthFactor) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity()
The current capacity.
|
void |
ensureCapacity(int newCapacity)
Ensure the array has at least the capacity requested.
|
int |
getOrDefault(long key,
int defaultValue)
Fetch the integer mapped to the given key or defaultValue if
that key does not exist.
|
double |
growthFactor()
The proportion by which this array will automatically grow when full.
|
long[] |
keys()
Return an array of all key values, in order of insertion.
|
boolean |
putIfAbsent(long key,
int value)
Set the value for a given key if that key is not already in use.
|
void |
reset(int newCapacity)
Clear the array and set a new capacity if not already large enough.
|
int |
size()
The number of items in this array.
|
public static final int DEFAULT_INITIAL_CAPACITY
public static final double DEFAULT_GROWTH_FACTOR
public PrimitiveLongIntKeyValueArray(int initialCapacity,
double growthFactor)
public PrimitiveLongIntKeyValueArray(int initialCapacity)
public PrimitiveLongIntKeyValueArray()
public int capacity()
public double growthFactor()
public void ensureCapacity(int newCapacity)
newCapacity - the new capacity requirementpublic int size()
public int getOrDefault(long key,
int defaultValue)
key - the handle for the required valuedefaultValue - value to return if the key is not foundpublic boolean putIfAbsent(long key,
int value)
key - the key against which to put the valuevalue - the value to includepublic void reset(int newCapacity)
newCapacity - the new capacity requirementpublic long[] keys()
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.