|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
PATRICIA trie (Practical Algorithm To Retrieve Information Coded In Alphanumeric).
Tries are a kind of tree where each node holds a common part of one or more keys.
PATRICIA trie is one of the many existing variants of the trie, which adds path compression
by grouping common sequences of nodes together.
This structure provides a very efficient way of storing values while maintaining the lookup time
for a key in O(N) in the worst case, where N is the length of the longest key.
This structure has it's main use in IP routing software, but can provide an interesting alternative
to other structures such as hashtables when memory space is of concern.
| Method Summary | |
|---|---|
T |
add(PatriciaTrieKey key,
T obj)
Add new key to the trie |
void |
clear()
Clear the trie: remove all elements from trie |
java.util.ArrayList<T> |
elements()
Get list of all elements in the Trie |
T |
findBestMatch(PatriciaTrieKey key)
Find best match with specified key |
T |
findExactMatch(PatriciaTrieKey key)
Find exact match with specified key |
T |
remove(PatriciaTrieKey key)
Removes key from the triesKFind exact match with specified key |
| Methods inherited from interface org.garret.perst.IPersistent |
|---|
assignOid, deallocate, getOid, getStorage, invalidate, isDeleted, isModified, isPersistent, isRaw, load, loadAndModify, makePersistent, modify, onLoad, onStore, recursiveLoading, store |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Methods inherited from interface org.garret.perst.IResource |
|---|
exclusiveLock, exclusiveLock, reset, sharedLock, sharedLock, unlock |
| Methods inherited from interface org.garret.perst.ITable |
|---|
select |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Method Detail |
|---|
T add(PatriciaTrieKey key,
T obj)
key - bit vectorobj - persistent object associated with this key
null if there
was no such objectvoid clear()
clear in interface java.util.Collectionjava.util.ArrayList<T> elements()
T findBestMatch(PatriciaTrieKey key)
key - bit vector
T findExactMatch(PatriciaTrieKey key)
key - bit vector
T remove(PatriciaTrieKey key)
key - bit vector
null if such key is not found
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||