public class MutableDoubleArrayTrieInteger extends Object implements Serializable, Iterable<MutableDoubleArrayTrieInteger.KeyValuePair>, ICacheAble
| Modifier and Type | Class and Description |
|---|---|
class |
MutableDoubleArrayTrieInteger.KeyValuePair |
| Constructor and Description |
|---|
MutableDoubleArrayTrieInteger() |
MutableDoubleArrayTrieInteger(CharacterMapping charMap) |
MutableDoubleArrayTrieInteger(Map<String,Integer> stringIntegerMap) |
MutableDoubleArrayTrieInteger(Set<Map.Entry<String,Integer>> entrySet) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String key)
非覆盖模式添加,值默认为当前集合大小
|
boolean |
add(String key,
int value)
非覆盖模式添加
|
void |
clear() |
List<int[]> |
commonPrefixSearch(String query,
int start)
查询与query的前缀重合的所有词语
|
boolean |
containsKey(String key) |
void |
decreaseValues(int from)
将值大于等于from的统一递减1
|
int |
delete(String key)
删除键
|
Set<Map.Entry<String,Integer>> |
entrySet() |
List<int[]> |
findAllWithSupplementary(String query,
int start) |
int[] |
findLongest(CharSequence query,
int start)
最长查询
|
int[] |
findWithSupplementary(String query,
int start) |
int |
get(String key)
精确查询
|
int |
get(String key,
int start)
精确查询
|
int |
getBaseArraySize() |
int |
getCheckArraySize() |
int |
getEmptySize()
获取空闲的数组元素个数
|
int |
getFreeSize() |
int |
getMaximumValue()
可以设置的最大值
|
boolean |
insert(String key,
int value)
覆盖模式添加
|
boolean |
insert(String key,
int value,
boolean overwrite)
插入条目
|
boolean |
isEmpty() |
protected boolean |
isEmpty(int index) |
MutableDoubleArrayTrieInteger.KeyValuePair |
iterator() |
Set<String> |
keySet() |
boolean |
load(ByteArray byteArray)
载入
|
void |
loseWeight()
去掉多余的buffer
|
List<String> |
prefixMatch(String prefix)
查询以prefix开头的所有键
|
boolean |
put(String key,
int value)
设置键值 (同set)
|
int |
remove(String key)
删除键
|
void |
save(DataOutputStream out)
写入
|
boolean |
set(String key,
int value)
设置键值 (同put)
|
void |
setExponentialExpandFactor(double exponentialExpandFactor)
指数膨胀的底数
|
void |
setExponentialExpanding(boolean exponentialExpanding)
激活指数膨胀
|
void |
setLinearExpandFactor(int linearExpandFactor)
设置线性膨胀
|
int |
size()
键值对个数
|
int |
stateValue(int state) |
int |
transfer(int state,
int codePoint)
转移状态
|
int[] |
transferValues(int state,
int codePoint)
转移状态并输出值
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic MutableDoubleArrayTrieInteger(Map<String,Integer> stringIntegerMap)
public MutableDoubleArrayTrieInteger(Set<Map.Entry<String,Integer>> entrySet)
public MutableDoubleArrayTrieInteger()
public MutableDoubleArrayTrieInteger(CharacterMapping charMap)
public void setExponentialExpanding(boolean exponentialExpanding)
exponentialExpanding - public void setExponentialExpandFactor(double exponentialExpandFactor)
exponentialExpandFactor - public void setLinearExpandFactor(int linearExpandFactor)
linearExpandFactor - public void clear()
public int getCheckArraySize()
public int getFreeSize()
public int getBaseArraySize()
protected boolean isEmpty(int index)
public boolean insert(String key, int value, boolean overwrite)
key - 键value - 值overwrite - 是否覆盖public int size()
public boolean isEmpty()
public boolean insert(String key, int value)
key - value - public boolean add(String key, int value)
key - value - public boolean add(String key)
key - public List<String> prefixMatch(String prefix)
prefix - public int[] findLongest(CharSequence query, int start)
query - start - public int[] findWithSupplementary(String query, int start)
public List<int[]> commonPrefixSearch(String query, int start)
query - start - public int[] transferValues(int state,
int codePoint)
state - codePoint - charpublic int transfer(int state,
int codePoint)
state - codePoint - public int stateValue(int state)
public void loseWeight()
public void decreaseValues(int from)
from - public int get(String key, int start)
key - start - public int get(String key)
key - public boolean set(String key, int value)
key - value - public boolean put(String key, int value)
key - value - public int remove(String key)
key - public int delete(String key)
key - public int getEmptySize()
public int getMaximumValue()
public MutableDoubleArrayTrieInteger.KeyValuePair iterator()
iterator in interface Iterable<MutableDoubleArrayTrieInteger.KeyValuePair>public boolean containsKey(String key)
public void save(DataOutputStream out) throws IOException
ICacheAblesave in interface ICacheAbleIOExceptionpublic boolean load(ByteArray byteArray)
ICacheAbleload in interface ICacheAbleCopyright © 2014–2021 码农场. All rights reserved.