V
- the value type.public class Trie<V> extends Object
Modifier and Type | Class and Description |
---|---|
class |
Trie.KeyIterator |
class |
Trie.Node |
Constructor and Description |
---|
Trie()
Create an emptry Trie.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsPrefix(CharSequence prefix)
Checks if the given string is a prefix of a key in the Trie.
|
boolean |
containsPrefix(CharSequence prefix,
int offset,
int length)
Checks if the given character sequence matches against the trie starting at the given offset
in the key string using a specified number of characters.
|
V |
get(Object key) |
Trie.Node |
getNode(CharSequence key)
Try to match the character sequence given in key against the trie.
|
Trie.Node |
getNode(CharSequence key,
int offset)
Try to match the character sequence given in key against the trie starting at the given
offset in the key string.
|
Trie.Node |
getNode(CharSequence key,
int offset,
int length)
Try to match the character sequence given in key against the trie starting at the given
offset in the key string using a specified number of characters.
|
boolean |
isEmpty() |
Iterator<String> |
keyIterator() |
Set<String> |
keys() |
V |
put(CharSequence key,
V value) |
void |
putAll(Map<? extends CharSequence,? extends V> t) |
int |
size() |
Collection<V> |
values() |
public void clear()
Map.clear()
public V put(CharSequence key, V value)
key
- the key.value
- the value.Map.put(java.lang.Object, java.lang.Object)
public Trie.Node getNode(CharSequence key, int offset)
key
- the key.offset
- the offset.public Trie.Node getNode(CharSequence key)
key
- the key.public Trie.Node getNode(CharSequence key, int offset, int length)
key
- the key.offset
- the offset.length
- the length.public boolean containsKey(Object key)
public boolean containsPrefix(CharSequence prefix)
prefix
- the prefix.public boolean containsPrefix(CharSequence prefix, int offset, int length)
prefix
- the prefix.offset
- the offset.length
- the length to match.public boolean isEmpty()
public void putAll(Map<? extends CharSequence,? extends V> t)
public int size()
public Collection<V> values()
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.