university
Class PersonFactory
java.lang.Object
university.PersonFactory
- Direct Known Subclasses:
- EmployeeFactory, StudentFactory
public abstract class PersonFactory
- extends java.lang.Object
Abstract Factory Class to build the person infromation from commands entered
from the console.
Constructor Summary |
PersonFactory()
Creates a new instance of BuildPerson |
Method Summary |
protected void |
buildPersonInfo()
Builds the person infromation from the console input |
static Person |
createPerson()
createPerson call the correct builder based on the choice |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
unit
protected Unit unit
name
protected java.lang.String name
address
protected Address address
gender
protected Sex gender
console
protected java.io.BufferedReader console
PersonFactory
public PersonFactory()
- Creates a new instance of BuildPerson
buildPersonInfo
protected void buildPersonInfo()
- Builds the person infromation from the console input
createPerson
public static Person createPerson()
- createPerson call the correct builder based on the choice
- Returns:
- Person The newly created person.