fixbug WordTree覆写clear方法✒️

This commit is contained in:
大火yzs
2021-05-08 00:40:17 +08:00
parent 442d4bd854
commit ddf384884b
2 changed files with 36 additions and 1 deletions

View File

@@ -321,5 +321,16 @@ public class WordTree extends HashMap<Character, WordTree> {
this.endCharacterSet.add(c);
}
}
/**
* 清除所有的词,
* 此方法调用后, wordTree 将被清空
* endCharacterSet 也将清空
*/
@Override
public void clear() {
super.clear();
this.endCharacterSet.clear();
}
//--------------------------------------------------------------------------------------- Private method end
}