edu.columbia.surge.hashImpl
Class ParticFactoryH
java.lang.Object
|
+--edu.columbia.surge.hashImpl.ParticFactoryH
- public class ParticFactoryH
- extends java.lang.Object
- implements ParticFactory
This class holds the factory methods for the Partic class. Users
can use this class to create instances of Partic objects with their
desired parameters. A static keyword is used to instantiate an
instance of ParticFactoryH so that the static variable "factory" in
this class will have access to the create methods. Users can also
create instances of ParticH directly using the constructors of the
Partic class. The primary reason of the creation of this class is
to allow the Partic class, which implements the Partic interface to
have constructors while being able to implement all the methods in
the interface.
- See Also:
ParticH
Field Summary |
static ParticFactoryH |
factory
The static instance which helps users to access to the methods
in this class. |
Method Summary |
Partic |
create()
A factory method which creates a default instance of ParticH. |
Partic |
create(java.lang.String particName,
FD particBody)
A factory method which creates an instance of ParticH with the
given name and the body of the participant. |
Partic |
create(java.lang.String subjectName,
FD subjectBody,
java.lang.String objectName,
FD objectBody)
A factory method which creates an instance of ParticH with the
given names and the bodies of the participant. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
factory
public static ParticFactoryH factory
- The static instance which helps users to access to the methods
in this class.
create
public Partic create()
- A factory method which creates a default instance of ParticH.
- Specified by:
- create in interface ParticFactory
- Returns:
- a default instance of ParticH
create
public Partic create(java.lang.String particName,
FD particBody)
throws InvalidConstructorException
- A factory method which creates an instance of ParticH with the
given name and the body of the participant. If invalid name and
body are entered, an exception will be thrown.
- Specified by:
- create in interface ParticFactory
- Parameters:
particName
- the name of the type of participantparticbody
- the specification of the participant- Returns:
- an instance of ParticH with the given participant's
name and body
- Throws:
- InvalidConstructorException -
create
public Partic create(java.lang.String subjectName,
FD subjectBody,
java.lang.String objectName,
FD objectBody)
throws InvalidConstructorException
- A factory method which creates an instance of ParticH with the
given names and the bodies of the participant. There are a lot
of instances participants come in the form of pairs. This
factory method allows users to create participant pairs in one
line of code. If invalid names and body entries are entered, an
exception will be thrown.
- Specified by:
- create in interface ParticFactory
- Parameters:
subjectName
- the name of the type of the first
participantsubjectBody
- the body specification of the first
participantobjectName
- the name of the type of the other participantobjectBody
- the body specification of the other
participant- Returns:
- an instance of ParticH with the given partcipant pair.
- Throws:
- InvalidConstructorException -