TriePrefix (gb.data)
该类提供部分字典树的只读视图。允许检查具有公共前缀的键。
Properties
Key
|
Return the relative key of the last enumerated object.
|
Prefix
|
Return the prefix string of this object.
|
Methods
Add
|
Add bytes to the prefix. If the extended prefix does not exist within the
Trie, an error is raised.
|
Exist
|
Return if the given key exists relative to the prefix. This returns the
same as hTrie.Exist(hPrefix.Prefix & RelKey).
|
Remove
|
Remove bytes from the end of the prefix. There is no way this function
can fail since it removes Min(Len(hPrefix.Prefix), Length) bytes and
if the TriePrefix was valid, the weaker prefix will also be valid.
|
搜索从字典树的中间开始,因此速度更快(与
相同 前缀下的
重复 查找相比)。
当更改字典树时,TriePrefix对象将失效,因此如果要持久地存储它们,请小心。