Parsing Engine

danbikel.parser
Class WordListFactory

java.lang.Object
  extended bydanbikel.parser.WordListFactory

public class WordListFactory
extends Object

Provides methods to create new WordList objects. Depending on the size given, different implementations of the WordList interface are returned by the factory methods.


Method Summary
static WordList newList(Collection c)
          Returns a new WordList object containing the words of the specified collection.
static WordList newList(int size)
          Returns a new WordList object of the specified size.
static WordList newList(SexpList list)
          Returns a new WordList object containing Word objects constructed from the elements of the specified list, using the Word.Word(Sexp) constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newList

public static WordList newList(int size)
Returns a new WordList object of the specified size. Different WordList implementations are returned depending on whether the size is 1 or greater than 1. If the size is 0, a xanonical empty word list object is returned.

Returns:
a WordList object of the specified size

newList

public static WordList newList(SexpList list)
Returns a new WordList object containing Word objects constructed from the elements of the specified list, using the Word.Word(Sexp) constructor. Different WordList implementations are returned depending on whether the size of the specified list is 1 or greater than 1. If the size is 0, a canonical empty word list object is returned.

Returns:
a WordList object of the specified size

newList

public static WordList newList(Collection c)
Returns a new WordList object containing the words of the specified collection. Different WordList implementations are returned depending on whether the size of the specified collection is 1 or greater than 1. If the size is 0, a canonical empty word list object is returned.

Returns:
a WordList object of the specified size
Throws:
ClassCastException - if any of the objects in the specified collection are not instances of Word

Parsing Engine

Author: Dan Bikel.