Package owl.collections
Class HashTrieSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<List<E>>
-
- owl.collections.HashTrieSet<E>
-
public class HashTrieSet<E> extends AbstractSet<List<E>> implements TrieSet<E>
A TrieMap is a Map with sequences as keys that are organized in a Trie for value retrieval.
-
-
Constructor Summary
Constructors Constructor Description HashTrieSet()
HashTrieSet(Collection<? extends List<E>> collection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(List<E> es)
void
clear()
boolean
contains(Object o)
boolean
containsKeyWithPrefix(List<?> prefix)
void
forEach(Consumer<? super List<E>> action)
boolean
isEmpty()
Iterator<List<E>>
iterator()
boolean
remove(Object o)
int
size()
Stream<List<E>>
stream()
TrieSet<E>
subTrie(List<? extends E> prefix)
Retrieves the trieSet associated with the given prefix.Map<E,? extends TrieSet<E>>
subTries()
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, toArray
-
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
HashTrieSet
public HashTrieSet()
-
HashTrieSet
public HashTrieSet(Collection<? extends List<E>> collection)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<E>
- Specified by:
isEmpty
in interfaceSet<E>
- Overrides:
isEmpty
in classAbstractCollection<List<E>>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceSet<E>
- Overrides:
contains
in classAbstractCollection<List<E>>
-
add
public boolean add(List<E> es)
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceSet<E>
- Overrides:
add
in classAbstractCollection<List<E>>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceSet<E>
- Overrides:
remove
in classAbstractCollection<List<E>>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceSet<E>
- Overrides:
clear
in classAbstractCollection<List<E>>
-
size
public int size()
- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceSet<E>
- Specified by:
size
in classAbstractCollection<List<E>>
-
containsKeyWithPrefix
public boolean containsKeyWithPrefix(List<?> prefix)
- Specified by:
containsKeyWithPrefix
in interfaceTrieSet<E>
-
subTrie
public TrieSet<E> subTrie(List<? extends E> prefix)
Description copied from interface:TrieSet
Retrieves the trieSet associated with the given prefix. Any changes to the subtrie are reflected in the trie set and vice-versa.
-
-