edu.vt.middleware.dictionary
Interface WordList

All Known Implementing Classes:
AbstractWordList, ArrayWordList, FileWordList

public interface WordList

Represents a random-access list of words.

Version:
$Revision: 1252 $ $Date: 2010-04-16 17:24:23 -0400 (Fri, 16 Apr 2010) $
Author:
Middleware Services

Method Summary
 java.lang.String get(int index)
          Gets the word at the given 0-based index.
 java.util.Comparator<java.lang.String> getComparator()
          Gets the comparator that should be used to compare a search term with candidate words in the list.
 java.util.Iterator<java.lang.String> iterator()
          Gets an iterator to traverse this word list from the 0th index.
 java.util.Iterator<java.lang.String> medianIterator()
          Gets an iterator to traverse this word list from the median.
 int size()
          Gets the number of words in the list.
 

Method Detail

getComparator

java.util.Comparator<java.lang.String> getComparator()
Gets 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

java.lang.String get(int index)
Gets the word at the given 0-based index.

Parameters:
index - 0-based index.
Returns:
Word at given index.

iterator

java.util.Iterator<java.lang.String> iterator()
Gets an iterator to traverse this word list from the 0th index.

Returns:
Iterator for this word list

medianIterator

java.util.Iterator<java.lang.String> medianIterator()
Gets an iterator to traverse this word list from the median.

Returns:
Iterator for this word list

size

int size()
Gets the number of words in the list.

Returns:
Total number of words in list.


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.