Package autocomplete.dna
Class SuffixCollection
- java.lang.Object
-
- java.util.AbstractCollection<CharSequence>
-
- autocomplete.dna.SuffixCollection
-
- All Implemented Interfaces:
Iterable<CharSequence>,Collection<CharSequence>
class SuffixCollection extends AbstractCollection<CharSequence>
Generates all (length - 1) suffixes of the given sequence of characters and presents them in a collection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSuffixCollection.SubSequenceA subsequence of the data between the given begin and end indices.private classSuffixCollection.SuffixA suffix of the data starting from the given begin index.
-
Field Summary
Fields Modifier and Type Field Description private CharSequencedata
-
Constructor Summary
Constructors Constructor Description SuffixCollection(CharSequence data)Constructs an unmodifiable collection of (length - 1) suffixes from the data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<CharSequence>iterator()intsize()-
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
data
private final CharSequence data
-
-
Constructor Detail
-
SuffixCollection
public SuffixCollection(CharSequence data)
Constructs an unmodifiable collection of (length - 1) suffixes from the data.- Parameters:
data- source for all suffixes.
-
-
Method Detail
-
iterator
public Iterator<CharSequence> iterator()
- Specified by:
iteratorin interfaceCollection<CharSequence>- Specified by:
iteratorin interfaceIterable<CharSequence>- Specified by:
iteratorin classAbstractCollection<CharSequence>
-
size
public int size()
- Specified by:
sizein interfaceCollection<CharSequence>- Specified by:
sizein classAbstractCollection<CharSequence>
-
-