uvi
Class WordLists

java.lang.Object
  extended by uvi.WordLists

public class WordLists
extends Object

Holds tokens (or 'words') separated into different lists. Each token is only allowed to be present once in a given list (a.k.a. each list holds unique tokens only). This class is used to aggregate tokens during the XML parsing to be used later on a reference page.

Version:
1.0, 2006.9.8
Author:
Derek Trumbo
See Also:
Sweeper.startNP(Node), Sweeper.startSELRESTR(Node), Sweeper.startSYNRESTR(Node), Sweeper.startPRED(Node), Sweeper.startTHEMROLE(Node), Sweeper.startDESCRIPTION(Node), Generator.generateReferencePage()

Nested Class Summary
(package private) static class WordLists.WordList
          Holds the information for a single list of tokens.
(package private) static class WordLists.WordListItem
          Represents a token and its associated reference count.
 
Field Summary
 ArrayList lists
          All lists of tokens.
 
Constructor Summary
WordLists()
           
 
Method Summary
 void addWord(String list, String word)
          Adds a token to the specified list.
 WordLists.WordList getList(String listName)
          Returns a list with the specified name.
 void sortByListCounts()
          Sorts the main list of lists by the list counts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lists

public ArrayList lists
All lists of tokens. Each element of this array is a single WordLists.WordList object which stores the name of the list and all tokens for that list.

Constructor Detail

WordLists

public WordLists()
Method Detail

addWord

public void addWord(String list,
                    String word)
Adds a token to the specified list. If the list does not yet exist, one is created. The token is not added to the list if it already exists. The token is added in alphabetical order.

See Also:
Sweeper.startNP(Node), Sweeper.startSELRESTR(Node), Sweeper.startSYNRESTR(Node), Sweeper.startPRED(Node)

getList

public WordLists.WordList getList(String listName)
Returns a list with the specified name.

Parameters:
listName - the name of the list to return
Returns:
the WordLists.WordList object that has the given name, or null if no such list exists
See Also:
Generator.generateReferencePage()

sortByListCounts

public void sortByListCounts()
Sorts the main list of lists by the list counts.

See Also:
Generator.printReferenceColumnSpecial(String)