| 限定符和类型 | 字段 | 说明 |
|---|---|---|
protected Map<Number,Integer> |
counter |
|
protected Map<Number,R> |
dict |
|
protected Map<R,Number> |
indexer |
|
protected boolean |
removeDictIfNonCount |
在字典值数量为0的时候是否删除该字典,如果是定时重建,并且快速删除,则没必要开启这个选项,开启了可以稍微节省点空间
|
| 构造器 | 说明 |
|---|---|
HashMapDict() |
|
HashMapDict(Integer capacity) |
适用于字典大小确定的情况下,饥饿初始化,避免扩容,同时提高hash的效率
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
containsDictValue(R r) |
是否包含某个字段
|
void |
decrDictCount(Number dictKey,
int count) |
减少一个字典key的数量
|
Map<Number,R> |
dictAll() |
所有字典键值
|
Set<R> |
dictValues() |
所有字典值
|
Number |
getDictKey(R r) |
查询字段值对应的字典key
|
R |
getDictValue(Number dictKey) |
查询字典key对应的字段值
|
int |
getSize() |
字典数量
|
void |
putDict(Number dictKey,
R dictValue) |
新增一个字典
|
void |
putDictObj(Number dictKey,
Object dictValue) |
新增一个字典
|
void |
removeDictKey(Number dictKey) |
删除一个字典key
|
void |
setRemoveDictIfNonCount(boolean removeDictIfNonCount) |
protected boolean removeDictIfNonCount
public HashMapDict()
public HashMapDict(Integer capacity)
public Number getDictKey(R r)
DictgetDictKey 在接口中 Dict<R>r - 字段值public R getDictValue(Number dictKey)
DictgetDictValue 在接口中 Dict<R>dictKey - 字典keypublic void putDictObj(Number dictKey, Object dictValue)
DictputDictObj 在接口中 Dict<R>dictKey - 字典keydictValue - 字段值public boolean containsDictValue(R r)
DictcontainsDictValue 在接口中 Dict<R>r - 字段public void decrDictCount(Number dictKey, int count)
DictdecrDictCount 在接口中 Dict<R>dictKey - 字典keycount - 减少的数量public void removeDictKey(Number dictKey)
DictremoveDictKey 在接口中 Dict<R>dictKey - 字典keypublic void setRemoveDictIfNonCount(boolean removeDictIfNonCount)
Copyright © 2024–2025. All rights reserved.