| 限定符和类型 | 类和说明 |
|---|---|
static class |
FlexibleHashMap.Entry<K,V> |
| 限定符和类型 | 字段和说明 |
|---|---|
protected LinkedList<FlexibleHashMap.Entry<K,V>>[] |
buckets |
protected AbstractEqualityComparator<? super K> |
comparator |
protected int |
currentPrime |
static int |
INITAL_BUCKET_CAPACITY |
static int |
INITAL_CAPACITY |
protected int |
initialBucketCapacity |
protected int |
initialCapacity |
static double |
LOAD_FACTOR |
protected int |
n
How many elements in set
|
protected int |
threshold
when to expand
|
| 构造器和说明 |
|---|
FlexibleHashMap() |
FlexibleHashMap(AbstractEqualityComparator<? super K> comparator) |
FlexibleHashMap(AbstractEqualityComparator<? super K> comparator,
int initialCapacity,
int initialBucketCapacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
protected void |
expand() |
V |
get(Object key) |
protected int |
getBucket(K key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
static void |
main(String[] args) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
String |
toTableString() |
Collection<V> |
values() |
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic static final int INITAL_CAPACITY
public static final int INITAL_BUCKET_CAPACITY
public static final double LOAD_FACTOR
@NotNull protected final AbstractEqualityComparator<? super K> comparator
protected LinkedList<FlexibleHashMap.Entry<K,V>>[] buckets
protected int n
protected int currentPrime
protected int threshold
protected final int initialCapacity
protected final int initialBucketCapacity
public FlexibleHashMap()
public FlexibleHashMap(@Nullable
AbstractEqualityComparator<? super K> comparator)
public FlexibleHashMap(@Nullable
AbstractEqualityComparator<? super K> comparator,
int initialCapacity,
int initialBucketCapacity)
protected int getBucket(K key)
public boolean containsKey(Object key)
containsKey 在接口中 Map<K,V>public boolean containsValue(Object value)
containsValue 在接口中 Map<K,V>protected void expand()
public String toTableString()
public static void main(String[] args)
Copyright © 1992–2022 Daniel Sun. All rights reserved.