O
- The type of the values associated with keys in the treepublic interface SuffixTree<O>
Modifier and Type | Method and Description |
---|---|
Iterable<CharSequence> |
getKeysContaining(CharSequence fragment)
Returns a lazy iterable which returns the set of keys in the tree which contain the given fragment.
|
Iterable<CharSequence> |
getKeysEndingWith(CharSequence suffix)
Returns a lazy iterable which returns the set of keys in the tree which end with the given suffix.
|
Iterable<KeyValuePair<O>> |
getKeyValuePairsForKeysContaining(CharSequence fragment)
Returns a lazy iterable which returns the set of
KeyValuePair s for keys and their associated values in
the tree, where the keys contain the given fragment. |
Iterable<KeyValuePair<O>> |
getKeyValuePairsForKeysEndingWith(CharSequence suffix)
Returns a lazy iterable which returns the set of
KeyValuePair s for keys and their associated values in
the tree, where the keys end with the given suffix. |
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.
|
Iterable<O> |
getValuesForKeysContaining(CharSequence fragment)
Returns a lazy iterable which returns the set of values associated with keys in the tree which contain the given
fragment.
|
Iterable<O> |
getValuesForKeysEndingWith(CharSequence suffix)
Returns a lazy iterable which returns the set of values associated with keys in the tree which end with the
given suffix.
|
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.
|
O put(CharSequence key, O value)
key
- The key with which the specified value should be associatedvalue
- The value to associate with the key, which cannot be nullO putIfAbsent(CharSequence key, O value)
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)
key
- The key for which an associated value should be removedO getValueForExactKey(CharSequence key)
key
- The key with which a sought value might be associatedIterable<CharSequence> getKeysEndingWith(CharSequence suffix)
suffix
- A suffix of sought keys in the treeIterable<O> getValuesForKeysEndingWith(CharSequence suffix)
#equals(Object)
).suffix
- A suffix of keys in the tree for which associated values are soughtIterable<KeyValuePair<O>> getKeyValuePairsForKeysEndingWith(CharSequence suffix)
KeyValuePair
s for keys and their associated values in
the tree, where the keys end with the given suffix.
This is inclusive - if the given suffix is an exact match for a key in the tree, the KeyValuePair
for that key is also returned.suffix
- A suffix of keys in the tree for which associated KeyValuePair
s are soughtKeyValuePair
s for keys in the tree which end with the given suffix, inclusiveIterable<CharSequence> getKeysContaining(CharSequence fragment)
fragment
- A fragment of sought keys in the treeIterable<O> getValuesForKeysContaining(CharSequence fragment)
fragment
- A fragment of keys in the tree for which associated values are soughtIterable<KeyValuePair<O>> getKeyValuePairsForKeysContaining(CharSequence fragment)
KeyValuePair
s for keys and their associated values in
the tree, where the keys contain the given fragment.
This is inclusive - if the given fragment is an exact match for a key in the tree, the
KeyValuePair
for that key is also returned.fragment
- A fragment of keys in the tree for which associated KeyValuePair
s are soughtKeyValuePair
s for keys in the tree which contain the given fragment, inclusiveint size()
ConcurrentHashMap.size()
.Copyright © 2016. All rights reserved.