public class PathTrie extends Object
Constructor and Description |
---|
PathTrie()
Construct a new PathTrie with a root node.
|
Modifier and Type | Method and Description |
---|---|
void |
addPath(String path)
Add a path to the path trie.
|
void |
clear()
Clear all nodes in the trie.
|
void |
deletePath(String path)
Delete a path from the trie.
|
boolean |
existsNode(String path)
Return true if the given path exists in the trie, otherwise return false;
All paths are relative to the root node.
|
String |
findMaxPrefix(String path)
Return the largest prefix for the input path.
|
public void addPath(String path)
path
- the path to add to the triepublic void deletePath(String path)
path
- the path to be deletedpublic boolean existsNode(String path)
path
- the input pathpublic String findMaxPrefix(String path)
path
- the input pathpublic void clear()
Copyright © 2008–2023 The Apache Software Foundation. All rights reserved.