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.
  • Field Details

  • Constructor Details

    • AbstractWordList

      public AbstractWordList()
  • Method Details

    • getComparator

      public Comparator<CharSequence> 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 interface WordList
      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.
      Specified by:
      iterator in interface WordList
      Returns:
      iterator for this word list
    • 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 interface WordList
      Returns:
      iterator for this word list
    • checkRange

      protected void checkRange(int index)
      Throws an IndexOutOfBoundsException if the supplied index is less than 0 or greater than or equal to the size of this word list.
      Parameters:
      index - to check