T - payload typepublic interface PrefixDictionary<T extends Serializable> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all contained words and playload data.
|
boolean |
contains(char[] word)
Check if a word is included exactly in the trie.
|
default boolean |
contains(String word)
Check if a word is included exactly in the trie.
|
boolean |
containsPrefix(char[] word)
Check if a word is either included completely or as prefix in the trie.
|
default boolean |
containsPrefix(String word)
Check if a word is either included completely or as prefix in the trie.
|
void |
delete(char[] word)
Delete the data associated with the given word.
|
default void |
delete(String word)
Delete the data associated with the given word.
|
T |
getData(char[] word)
Get data associated with the word in the trie, or null if the word was
not included.
|
default T |
getData(String word)
Get data associated with the word in the trie, or null if the word was
not included.
|
int |
getDepth()
Get depth of the trie.
|
default void |
insert(char[] word)
Insert a word (with no payload data) inside the trie.
|
default void |
insert(char[] word,
int startIndex,
int endIndex)
Insert a substring of word (with no payload data) inside the trie.
|
void |
insert(char[] word,
int startIndex,
int endIndex,
T data)
Insert a substring of word with payload data inside the trie.
|
default void |
insert(char[] word,
T data)
Insert a word with payload data inside the trie.
|
default void |
insert(String word)
Insert a word (with no payload data) inside the trie.
|
default void |
insert(String word,
int startIndex,
int endIndex)
Insert a substring of word (with no payload data) inside the trie.
|
default void |
insert(String word,
int startIndex,
int endIndex,
T data)
Insert a substring of word with payload data inside the trie.
|
default void |
insert(String word,
T data)
Insert a word with payload data inside the trie.
|
void |
updateOrInsertData(char[] word,
Function<T,T> updateFunction)
Insert or update data in the trie.
|
default void |
updateOrInsertData(String word,
Function<T,T> updateFunction)
Insert or update data in the trie.
|
default void insert(String word)
word - word to be inserteddefault void insert(char[] word)
word - word to be inserteddefault void insert(String word, T data)
word - word to be inserteddata - payload datadefault void insert(char[] word,
T data)
word - word to be inserteddata - payload datadefault void insert(String word, int startIndex, int endIndex)
word - word to be insertedstartIndex - index to begin the substring with (inclusive)endIndex - index to end the substring at (exclusive)default void insert(char[] word,
int startIndex,
int endIndex)
word - word to be insertedstartIndex - index to begin the substring with (inclusive)endIndex - index to end the substring at (exclusive)default void insert(String word, int startIndex, int endIndex, T data)
word - word to be insertedstartIndex - index to begin the substring with (inclusive)endIndex - index to end the substring at (exclusive)data - payload datavoid insert(char[] word,
int startIndex,
int endIndex,
T data)
word - word to be insertedstartIndex - index to begin the substring with (inclusive)endIndex - index to end the substring at (exclusive)data - payload datavoid clear()
default boolean containsPrefix(String word)
word - word to search forboolean containsPrefix(char[] word)
word - word to search fordefault boolean contains(String word)
word - word to search forboolean contains(char[] word)
word - word to search fordefault void delete(String word)
word - word to search forvoid delete(char[] word)
word - word to search fordefault T getData(String word)
word - word to searchT getData(char[] word)
word - word to searchdefault void updateOrInsertData(String word, Function<T,T> updateFunction)
word - word to searchupdateFunction - function that returns the inserted value (if input data is
null) or returns the updates value (if input data is present)void updateOrInsertData(char[] word,
Function<T,T> updateFunction)
word - word to searchupdateFunction - function that returns the inserted value (if input data is
null) or returns the updates value (if input data is present)int getDepth()
Copyright © 2015 illucIT Software GmbH. All rights reserved.