|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.dictionary.WordLists
public final class WordLists
Utility class for common operations on word lists.
| Field Summary | |
|---|---|
static java.util.Comparator<java.lang.String> |
CASE_INSENSITIVE_COMPARATOR
Case insensitive comparator. |
static java.util.Comparator<java.lang.String> |
CASE_SENSITIVE_COMPARATOR
Case sensitive comparator. |
static int |
NOT_FOUND
Index returned when word not found by binary search. |
| Method Summary | |
|---|---|
static int |
binarySearch(WordList wordList,
java.lang.String word)
Performs a binary search of the given word list for the given word. |
static ArrayWordList |
createFromReader(java.io.Reader[] readers)
Creates a case-sensitive ArrayWordList by reading the contents of
the given readers. |
static ArrayWordList |
createFromReader(java.io.Reader[] readers,
boolean caseSensitive)
Creates an ArrayWordList by reading the contents of the given
readers. |
static ArrayWordList |
createFromReader(java.io.Reader[] readers,
boolean caseSensitive,
ArraySorter sorter)
Creates an ArrayWordList by reading the contents of the given file
with support for sorting file contents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Comparator<java.lang.String> CASE_SENSITIVE_COMPARATOR
public static final java.util.Comparator<java.lang.String> CASE_INSENSITIVE_COMPARATOR
public static final int NOT_FOUND
| Method Detail |
|---|
public static int binarySearch(WordList wordList,
java.lang.String word)
wordList - Word list to searchword - Word to search for.
public static ArrayWordList createFromReader(java.io.Reader[] readers)
throws java.io.IOException
ArrayWordList by reading the contents of
the given readers.
readers - Array of readers.
java.io.IOException - if an error occurs reading from a reader
public static ArrayWordList createFromReader(java.io.Reader[] readers,
boolean caseSensitive)
throws java.io.IOException
ArrayWordList by reading the contents of the given
readers.
readers - Array of readers.caseSensitive - Set to true to create case-sensitive word list
(default), false otherwise.
java.io.IOException - if an error occurs reading from a reader
public static ArrayWordList createFromReader(java.io.Reader[] readers,
boolean caseSensitive,
ArraySorter sorter)
throws java.io.IOException
ArrayWordList by reading the contents of the given file
with support for sorting file contents.
readers - Array of readers.caseSensitive - Set to true to create case-sensitive word list
(default), false otherwise.sorter - To sort the input array with
java.io.IOException - if an error occurs reading from a reader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||