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 booleanadd(List<E> es)voidclear()booleancontains(Object o)booleancontainsKeyWithPrefix(List<?> prefix)voidforEach(Consumer<? super List<E>> action)booleanisEmpty()Iterator<List<E>>iterator()booleanremove(Object o)intsize()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:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceSet<E>- Overrides:
isEmptyin classAbstractCollection<List<E>>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceSet<E>- Overrides:
containsin classAbstractCollection<List<E>>
-
add
public boolean add(List<E> es)
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceSet<E>- Overrides:
addin classAbstractCollection<List<E>>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceSet<E>- Overrides:
removein classAbstractCollection<List<E>>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classAbstractCollection<List<E>>
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<List<E>>
-
containsKeyWithPrefix
public boolean containsKeyWithPrefix(List<?> prefix)
- Specified by:
containsKeyWithPrefixin interfaceTrieSet<E>
-
subTrie
public TrieSet<E> subTrie(List<? extends E> prefix)
Description copied from interface:TrieSetRetrieves the trieSet associated with the given prefix. Any changes to the subtrie are reflected in the trie set and vice-versa.
-
-