|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.zookeeper.common.PathTrie
public class PathTrie
a class that implements prefix matching for components of a filesystem path. the trie looks like a tree with edges mapping to the component of a path. example /ab/bc/cf would map to a trie / ab/ (ab) bc/ / (bc) cf/ (cf)
Constructor Summary | |
---|---|
PathTrie()
construct a new PathTrie with a root node of / |
Method Summary | |
---|---|
void |
addPath(java.lang.String path)
add a path to the path trie |
void |
deletePath(java.lang.String path)
delete a path from the trie |
java.lang.String |
findMaxPrefix(java.lang.String path)
return the largest prefix for the input path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathTrie()
Method Detail |
---|
public void addPath(java.lang.String path)
path
- public void deletePath(java.lang.String path)
path
- the path to be deletedpublic java.lang.String findMaxPrefix(java.lang.String path)
path
- the input path
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |