public class SmartForest<T> extends Object implements Comparable<SmartForest<T>>, Serializable
| Modifier and Type | Field and Description |
|---|---|
SmartForest<T>[] |
branches
status 此字的状态1,继续 2,是个词语但是还可以继续 ,3确定 nature 词语性质
|
| Constructor and Description |
|---|
SmartForest() |
SmartForest(char c,
int status,
T param) |
SmartForest(double rate) |
| Modifier and Type | Method and Description |
|---|---|
SmartForest<T> |
add(SmartForest<T> branch)
增加子页节点
|
void |
add(String keyWord,
T t)
增加新词
|
void |
addBranch(String keyWord,
T t)
增加一个元素到节点
|
void |
clear()
清空
|
int |
compareTo(char c) |
int |
compareTo(SmartForest<T> o) |
boolean |
contains(char c)
二分查找是否包含
|
boolean |
equals(char c) |
SmartForest<T> |
get(char c) |
SmartForest<T> |
getBranch(char c) |
SmartForest<T> |
getBranch(char[] chars)
根据一个词获得所取的参数,没有就返回null
|
SmartForest<T> |
getBranch(String keyWord)
根据一个词获得所取的参数,没有就返回null
|
SmartForest<T>[] |
getBranches()
取得所有的分支
|
char |
getC() |
int |
getIndex(char c) |
T |
getParam() |
byte |
getStatus() |
SmartGetWord<T> |
getWord(char[] chars)
得到抽詞器
|
SmartGetWord<T> |
getWord(String str) |
int |
hashCode() |
void |
remove(String word)
删除一个词语
|
void |
setParam(T param) |
void |
setStatus(int status) |
Map<String,T> |
toMap()
将树转换为map
|
public SmartForest<T>[] branches
public SmartForest()
public SmartForest(double rate)
public SmartForest(char c,
int status,
T param)
public SmartForest<T> add(SmartForest<T> branch)
branch - public int getIndex(char c)
public boolean contains(char c)
c - public int compareTo(char c)
public boolean equals(char c)
public byte getStatus()
public void setStatus(int status)
public char getC()
public T getParam()
public void setParam(T param)
public int compareTo(SmartForest<T> o)
compareTo in interface Comparable<SmartForest<T>>public SmartForest<T> get(char c)
public SmartForest<T> getBranch(char c)
public SmartForest<T> getBranch(String keyWord)
keyWord - public SmartForest<T> getBranch(char[] chars)
chars - public SmartGetWord<T> getWord(String str)
public SmartGetWord<T> getWord(char[] chars)
chars - public SmartForest<T>[] getBranches()
public void remove(String word)
string - public void clear()
Copyright © 2017. All rights reserved.