Package org.passay.dictionary
Class AbstractWordList
java.lang.Object
org.passay.dictionary.AbstractWordList
- All Implemented Interfaces:
WordList
- Direct Known Subclasses:
AbstractFileWordList,ArrayWordList
Provides common operations implementations for word lists.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckRange(int index) Throws anIndexOutOfBoundsExceptionif the supplied index is less than 0 or greater than or equal to the size of this word list.Returns the comparator that should be used to compare a search term with candidate words in the list.iterator()Returns an iterator to traverse this word list from the 0th index.Returns an iterator to traverse this word list by following a recursive sequence of medians.
-
Field Details
-
comparator
Word comparator.
-
-
Constructor Details
-
AbstractWordList
public AbstractWordList()
-
-
Method Details
-
getComparator
Description copied from interface:WordListReturns 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.- Specified by:
getComparatorin interfaceWordList- Returns:
- comparator for words in the list.
-
iterator
Description copied from interface:WordListReturns an iterator to traverse this word list from the 0th index. -
medianIterator
Description copied from interface:WordListReturns an iterator to traverse this word list by following a recursive sequence of medians.- Specified by:
medianIteratorin interfaceWordList- Returns:
- iterator for this word list
-
checkRange
protected void checkRange(int index) Throws anIndexOutOfBoundsExceptionif the supplied index is less than 0 or greater than or equal to the size of this word list.- Parameters:
index- to check
-