O - The type of the values associated with keys in the treepublic interface InvertedRadixTree<O> extends RadixTree<O>
String.contains(CharSequence) on the document.
Time complexity is O(d) rather than O(dn), where d=length of document and n=number of keys/keywords.
This is an extension of RadixTree which provides additional traversal algorithms to implement this
functionality on top of the same tree structure. See documentation on each method for details.| Modifier and Type | Method and Description |
|---|---|
Iterable<CharSequence> |
getKeysContainedIn(CharSequence document)
Returns a lazy iterable which returns the set of keys in the tree which are contained in the given document.
|
Iterable<CharSequence> |
getKeysPrefixing(CharSequence document)
Returns a lazy iterable which returns the set of keys in the tree which prefix the given document.
|
KeyValuePair<O> |
getKeyValuePairForLongestKeyPrefixing(CharSequence document)
Returns the
KeyValuePair for the longest key in the tree which is a prefix of the given document. |
Iterable<KeyValuePair<O>> |
getKeyValuePairsForKeysContainedIn(CharSequence document)
Returns a lazy iterable which returns the set of
KeyValuePairs for keys in the tree which are contained
in the given document. |
Iterable<KeyValuePair<O>> |
getKeyValuePairsForKeysPrefixing(CharSequence document)
Returns a lazy iterable which returns the set of
KeyValuePairs for keys in the tree which prefix
the given document. |
CharSequence |
getLongestKeyPrefixing(CharSequence document)
Returns the longest key in the tree which is a prefix of the given document.
|
O |
getValueForExactKey(CharSequence key)
Returns the value associated with the given key (exact match), or returns null if no such value
is associated with the key.
|
O |
getValueForLongestKeyPrefixing(CharSequence document)
Returns the value associated with the longest key in the tree which is a prefix of the given document.
|
Iterable<O> |
getValuesForKeysContainedIn(CharSequence document)
Returns a lazy iterable which returns the set of values associated with keys in the tree which are contained
in the given document.
|
Iterable<O> |
getValuesForKeysPrefixing(CharSequence document)
Returns a lazy iterable which returns the set of values associated with keys in the tree which prefix
the given document.
|
O |
put(CharSequence key,
O value)
Associates the given value with the given key; replacing any previous value associated with the key.
|
O |
putIfAbsent(CharSequence key,
O value)
If a value is not already associated with the given key in the tree, associates the given value with the
key; otherwise if an existing value is already associated, returns the existing value and does not overwrite it.
|
boolean |
remove(CharSequence key)
Removes the value associated with the given key (exact match).
|
int |
size()
Counts the number of keys/values stored in the tree.
|
getClosestKeys, getKeysStartingWith, getKeyValuePairsForClosestKeys, getKeyValuePairsForKeysStartingWith, getValuesForClosestKeys, getValuesForKeysStartingWithO put(CharSequence key, O value)
O putIfAbsent(CharSequence key, O value)
putIfAbsent in interface RadixTree<O>key - The key with which the specified value should be associatedvalue - The value to associate with the key, which cannot be nullboolean remove(CharSequence key)
O getValueForExactKey(CharSequence key)
getValueForExactKey in interface RadixTree<O>key - The key with which a sought value might be associatedIterable<CharSequence> getKeysPrefixing(CharSequence document)
document - A document to be scanned for keys contained in the tree which prefix the given documentIterable<O> getValuesForKeysPrefixing(CharSequence document)
document - A document to be scanned for keys contained in the tree which prefix the given documentIterable<KeyValuePair<O>> getKeyValuePairsForKeysPrefixing(CharSequence document)
KeyValuePairs for keys in the tree which prefix
the given document.document - A document to be scanned for keys contained in the tree which prefix the given documentKeyValuePairs for keys in the tree which prefix the given documentCharSequence getLongestKeyPrefixing(CharSequence document)
document - A document to be scanned for a key contained in the tree which prefixes the given documentO getValueForLongestKeyPrefixing(CharSequence document)
document - A document to be scanned for a key contained in the tree which prefixes the given documentKeyValuePair<O> getKeyValuePairForLongestKeyPrefixing(CharSequence document)
KeyValuePair for the longest key in the tree which is a prefix of the given document.document - A document to be scanned for a key contained in the tree which prefixes the given documentKeyValuePair for the longest key in the tree which is a prefix of the given document,
or null if no such key is contained in the treeIterable<CharSequence> getKeysContainedIn(CharSequence document)
document - A document to be scanned for keys contained in the treeIterable<O> getValuesForKeysContainedIn(CharSequence document)
document - A document to be scanned for keys contained in the treeIterable<KeyValuePair<O>> getKeyValuePairsForKeysContainedIn(CharSequence document)
KeyValuePairs for keys in the tree which are contained
in the given document.document - A document to be scanned for keys contained in the treeKeyValuePairs for keys in the tree which are contained in the given documentCopyright © 2017. All Rights Reserved.