Class StringSetTrie
Object
StringSetTrie
A Trie / Prefix Tree that stores
String
s
efficiently.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionCreate with no elements.StringSetTrie
(Collection<String> collection) Create from existing collection.StringSetTrie
(Stream<String> stream) Create from existing collection. -
Method Summary
-
Constructor Details
-
StringSetTrie
public StringSetTrie()Create with no elements. -
StringSetTrie
Create from existing collection.- Parameters:
collection
- the collection to create from.
-
StringSetTrie
Create from existing collection.- Parameters:
stream
- the stream to create from.
-
-
Method Details
-
add
Adds an string to the set.- Parameters:
stringToAdd
- the string to add.
-
contains
Does the set contain a particular string?- Parameters:
string
- the string to check.- Returns:
- true iff it is contained within the set.
-
isEmpty
public boolean isEmpty()Does the set contain no elements?- Returns:
- if the set contains zero elements.
-
values
A view over the values in the set.- Returns:
- the values, avoiding creating a new object via caching.
-