Package org.passay.dictionary
Class AbstractWordList
- java.lang.Object
-
- org.passay.dictionary.AbstractWordList
-
- All Implemented Interfaces:
WordList
- Direct Known Subclasses:
AbstractFileWordList
,ArrayWordList
public abstract class AbstractWordList extends Object implements WordList
Provides common operations implementations for word lists.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected Comparator<String>
comparator
Word comparator.
-
Constructor Summary
Constructors Constructor Description AbstractWordList()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
checkIsString(Object o)
Deprecated.this method is no longer used and will be removed in a future releaseprotected void
checkRange(int index)
Throws anIndexOutOfBoundsException
if the supplied index is less than 0 or greater than or equal to the size of this word list.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.
-
-
-
Field Detail
-
comparator
protected Comparator<String> comparator
Word comparator.
-
-
Method Detail
-
getComparator
public Comparator<String> getComparator()
Description copied from interface:WordList
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.- Specified by:
getComparator
in interfaceWordList
- Returns:
- comparator for words in the list.
-
iterator
public Iterator<String> iterator()
Description copied from interface:WordList
Returns an iterator to traverse this word list from the 0th index.
-
medianIterator
public Iterator<String> medianIterator()
Description copied from interface:WordList
Returns an iterator to traverse this word list by following a recursive sequence of medians.- Specified by:
medianIterator
in interfaceWordList
- Returns:
- iterator for this word list
-
checkRange
protected void checkRange(int index)
Throws anIndexOutOfBoundsException
if the supplied index is less than 0 or greater than or equal to the size of this word list.- Parameters:
index
- to check
-
checkIsString
@Deprecated protected void checkIsString(Object o)
Deprecated.this method is no longer used and will be removed in a future releaseThrows aClassCastException
if the supplied object is not an instance ofString
.- Parameters:
o
- object to check
-
-