Class PrefixSet
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, NavigableSet<String>, Set<String>, SortedSet<String>
- Direct Known Subclasses:
SurtPrefixSet
Utility class for maintaining sorted set of string prefixes.
Redundant prefixes are coalesced into the shorter prefix.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanMaintains additional invariant: if one entry is a prefix of another, keep only the prefix.booleanTest whether the given String is prefixed by one of this set's entries.Methods inherited from class ConcurrentSkipListSet
ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, equals, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, removeAll, size, spliterator, subSet, subSet, tailSet, tailSetMethods inherited from class AbstractSet
hashCodeMethods inherited from class AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream
-
Constructor Details
-
PrefixSet
public PrefixSet()
-
-
Method Details
-
containsPrefixOf
Test whether the given String is prefixed by one of this set's entries.- Parameters:
s-- Returns:
- True if contains prefix.
-
add
Maintains additional invariant: if one entry is a prefix of another, keep only the prefix.- Specified by:
addin interfaceCollection<String>- Specified by:
addin interfaceSet<String>- Overrides:
addin classConcurrentSkipListSet<String>- See Also:
-