public class HashTrie<T> extends Object implements Trie<T>
Trie.TrieProxy<T>, Trie.Unmodifiable<T>, Trie.Util| Constructor and Description |
|---|
HashTrie() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all entries.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<CharSequence,T>> |
entrySet() |
boolean |
equals(Object other) |
T |
get(Object key)
Get the value for a key.
|
Map.Entry<CharSequence,T> |
getLongestMatch(CharSequence key)
Get the key value entry who's key is the longest prefix match.
|
Map.Entry<CharSequence,T> |
getLongestMatch(PushbackReader keyIn)
Get the key value entry who's key is the longest prefix match.
|
int |
getMaxKeyLength()
Get the maximum key length.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<CharSequence> |
keySet() |
T |
put(CharSequence key,
T value)
Add mapping.
|
void |
putAll(Map<? extends CharSequence,? extends T> map) |
T |
remove(Object key)
Remove a entry.
|
int |
size()
Get the number of entries.
|
String |
toString() |
Collection<T> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic Map.Entry<CharSequence,T> getLongestMatch(CharSequence key)
getLongestMatch in interface Trie<T>key - The key to lookuppublic Map.Entry<CharSequence,T> getLongestMatch(PushbackReader keyIn) throws IOException
getLongestMatch in interface Trie<T>keyIn - Pushback reader to read the key from. This should have a buffer at least as large as getMaxKeyLength() or an IOException may be thrown backing up.IOException - if keyIn.read() or keyIn.unread() does.public int getMaxKeyLength()
getMaxKeyLength in interface Trie<T>public void clear()
clear in interface Map<CharSequence,T>public boolean containsKey(Object key)
containsKey in interface Map<CharSequence,T>public boolean containsValue(Object value)
containsValue in interface Map<CharSequence,T>public T put(CharSequence key, T value) throws NullPointerException
put in interface Map<CharSequence,T>key - The mapping's key.value - value The mapping's valueNullPointerException - if key or value is null.public T remove(Object key) throws UnsupportedOperationException
remove in interface Map<CharSequence,T>UnsupportedOperationException - always.public void putAll(Map<? extends CharSequence,? extends T> map)
putAll in interface Map<CharSequence,T>public Set<CharSequence> keySet()
keySet in interface Map<CharSequence,T>public Collection<T> values()
values in interface Map<CharSequence,T>public Set<Map.Entry<CharSequence,T>> entrySet()
entrySet in interface Map<CharSequence,T>public T get(Object key)
get in interface Map<CharSequence,T>key - The key to look up.public int size()
size in interface Map<CharSequence,T>public boolean equals(Object other)
public int hashCode()
public boolean isEmpty()
isEmpty in interface Map<CharSequence,T>Copyright © 2017. All rights reserved.