|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.dictionary.AbstractWordList
edu.vt.middleware.dictionary.ArrayWordList
public class ArrayWordList
Provides a WordList backed by a string array. Since the entire word
list is stored in memory java heap settings may need to be modified in order
to store large word lists.
| Field Summary | |
|---|---|
protected java.lang.String[] |
words
file containing words. |
| Fields inherited from class edu.vt.middleware.dictionary.AbstractWordList |
|---|
comparator |
| Constructor Summary | |
|---|---|
ArrayWordList(java.lang.String[] array)
Creates a new case-sensitive word list backed by the given array. |
|
ArrayWordList(java.lang.String[] array,
boolean caseSensitive)
Creates a new word list backed by the given array. |
|
ArrayWordList(java.lang.String[] array,
boolean caseSensitive,
ArraySorter sorter)
Creates a new word list backed by the given array with optional sorting of the input string array. |
|
| Method Summary | |
|---|---|
java.lang.String |
get(int index)
Gets the word at the given 0-based index. |
int |
size()
Gets the number of words in the list. |
| Methods inherited from class edu.vt.middleware.dictionary.AbstractWordList |
|---|
checkIsString, checkRange, getComparator, iterator, medianIterator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String[] words
| Constructor Detail |
|---|
public ArrayWordList(java.lang.String[] array)
array - Array of words.
java.lang.IllegalArgumentException - If array is null or contains any null
entries.
public ArrayWordList(java.lang.String[] array,
boolean caseSensitive)
array - Array of words.caseSensitive - Set to true to create case-sensitive word list,
false otherwise.
java.lang.IllegalArgumentException - If array is null or contains any null
entries.
public ArrayWordList(java.lang.String[] array,
boolean caseSensitive,
ArraySorter sorter)
array - Array of words.caseSensitive - Set to true to create case-sensitive word list,
false otherwise.sorter - To sort the input array with. The sort routine is
consistent with AbstractWordList.getComparator(), which respects the case
sensitivity of the word list.
java.lang.IllegalArgumentException - If array is null or contains any null
entries.| Method Detail |
|---|
public java.lang.String get(int index)
index - 0-based index.
public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||