edu.columbia.surge.hashImpl
Class ProperFactoryH

java.lang.Object
  |
  +--edu.columbia.surge.hashImpl.ProperFactoryH

public class ProperFactoryH
extends java.lang.Object
implements ProperFactory

This class holds the factory methods for the Proper class. Users can use this class to create instances of Proper objects with their desired parameters. A static keyword is used to instantiate an instance of ProperFactoryH so that the static variable "factory" in this class will have access to the create methods. Users can also create instances of ProperH directly using the constructors of the Proper class. The primary reason of the creation of this class is to allow the Proper class, which implements the Proper interface to have constructors while being able to implement all the methods in the interface.

See Also:
ProperH

Field Summary
static ProperFactoryH factory
          The static instance which helps users to access to the methods in this class.
 
Method Summary
 Proper create()
          A factory method which creates a default instance of ProperFactoryH.
 Proper create(java.lang.String lex)
          A factory method to compute and return an object of type Proper with the given lexical entry An InvalidConstructorException will be thrown if the given lexical entry is invalid.
 Proper create(java.lang.String lex, boolean plurality)
          A factory method to compute and return an object of type Proper with the given lexical entry and specification of plurality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

public static ProperFactoryH factory
The static instance which helps users to access to the methods in this class.
Method Detail

create

public Proper create()
A factory method which creates a default instance of ProperFactoryH.
Specified by:
create in interface ProperFactory
Returns:
a default instance of ProperFactoryH

create

public Proper create(java.lang.String lex)
              throws InvalidConstructorException
A factory method to compute and return an object of type Proper with the given lexical entry An InvalidConstructorException will be thrown if the given lexical entry is invalid.
Specified by:
create in interface ProperFactory
Parameters:
lex - the proper noun
Returns:
an object of type Proper with the given lexical entry

create

public Proper create(java.lang.String lex,
                     boolean plurality)
              throws InvalidConstructorException
A factory method to compute and return an object of type Proper with the given lexical entry and specification of plurality. An InvalidConstructorException will be thrown if the given lexical entry is invalid.
Specified by:
create in interface ProperFactory
Parameters:
lex - the proper noun
plurality - set whether the proper noun should be plural, true to be plural.
Returns:
an object of type Proper with the given lexical entry and plurality