Package org.passay.dictionary
Interface WordList
-
- All Known Implementing Classes:
AbstractFileWordList
,AbstractWordList
,ArrayWordList
,FileWordList
,MemoryMappedFileWordList
public interface WordList
Represents a random-access list of words.- Author:
- Middleware Services
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
get(int index)
Returns the word at the given 0-based index.Comparator<String>
getComparator()
Returns the comparator that should be used to compare a search term with candidate words in the list.Iterator<String>
iterator()
Returns an iterator to traverse this word list from the 0th index.Iterator<String>
medianIterator()
Returns an iterator to traverse this word list by following a recursive sequence of medians.int
size()
Returns the number of words in the list.
-
-
-
Method Detail
-
getComparator
Comparator<String> getComparator()
Returns the comparator that should be used to compare a search term with candidate words in the list. The comparator naturally respects ordering and case sensitivity of the word list.- Returns:
- comparator for words in the list.
-
get
String get(int index)
Returns the word at the given 0-based index.- Parameters:
index
- 0-based index.- Returns:
- word at given index.
-
iterator
Iterator<String> iterator()
Returns an iterator to traverse this word list from the 0th index.- Returns:
- iterator for this word list
-
medianIterator
Iterator<String> medianIterator()
Returns an iterator to traverse this word list by following a recursive sequence of medians.- Returns:
- iterator for this word list
-
size
int size()
Returns the number of words in the list.- Returns:
- total number of words in list.
-
-