|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--SSF.OS.BGP4.Util.RadixTree
This class is used as an efficient way to store information which is keyed by a binary string (IP addresses, for example).
| Constructor Summary | |
RadixTree()
Constructs an empty radix tree. |
|
| Method Summary | |
java.lang.Object |
add(BitString bs,
java.lang.Object obj)
Attempts to add data to the tree, keyed by the given binary string, but fails if data associated with that string already exists. |
java.lang.Object |
find(BitString bs)
Returns the data associated with the given binary string, if any. |
java.util.ArrayList |
get_ancestors(BitString bs)
Examines each node in the tree which is associated with a proper prefix of the given binary string, and finds all of the ones which have (non-null) data associated with them. |
java.util.ArrayList |
get_descendants(BitString bs)
Examines each node in the tree whose binary string key has the given binary string as a proper prefix, and finds all of the ones which have (non-null) data associated with them. |
boolean |
has_descendants(BitString bs)
Determines whether or not any descendants of a given node have (non-null) data. |
java.lang.Object |
oldest_ancestor(BitString bs)
Examines each node in the tree which is associated with a proper prefix of the given binary string, and finds the shortest one which has (non-null) data associated with it. |
void |
print()
Prints all strings in the tree. |
void |
prune(BitString bs)
Prunes the subtree rooted at the node associated with the given binary string. |
java.lang.Object |
remove(BitString bs)
Removes and returns the data (if any) associated with the given binary string. |
java.lang.Object |
replace(BitString bs,
java.lang.Object obj)
Adds data to the tree, keyed by the given binary string, replacing any pre-existing data with that key which may have already been there. |
RadixTreeNode |
root()
Returns the root node of the tree. |
java.lang.Object |
youngest_ancestor(BitString bs)
Examines each node in the tree which is associated with a proper prefix of the given binary string, and finds the longest one which has (non-null) data associated with it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RadixTree()
| Method Detail |
public RadixTreeNode root()
public java.lang.Object replace(BitString bs,
java.lang.Object obj)
bs - The binary string to use as the key for the data.obj - The data to add to the tree.
public java.lang.Object add(BitString bs,
java.lang.Object obj)
bs - The binary string to use as the key for the additionobj - The data to add to the tree.
public java.lang.Object find(BitString bs)
bs - The bit string being used to key the find.
public java.util.ArrayList get_ancestors(BitString bs)
bs - The bit string being used to key the search.
public java.lang.Object oldest_ancestor(BitString bs)
bs - The bit string being used to key the search.
public java.lang.Object youngest_ancestor(BitString bs)
bs - The bit string being used to key the search.
public java.util.ArrayList get_descendants(BitString bs)
bs - The bit string which indicates the node to look for descendants
of.
public boolean has_descendants(BitString bs)
bs - The bit string which indicates the node to look for descendants
of.
public java.lang.Object remove(BitString bs)
bs - The bit string being used to key the removal.
public void prune(BitString bs)
bs - The bit string being used to key the pruning.public void print()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||