university
Class PersonFactory

java.lang.Object
  extended by 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.


Field Summary
protected  Address address
           
protected  java.io.BufferedReader console
           
protected  Sex gender
           
protected  java.lang.String name
           
protected  Unit unit
           
 
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
 

Field Detail

unit

protected Unit unit

name

protected java.lang.String name

address

protected Address address

gender

protected Sex gender

console

protected java.io.BufferedReader console
Constructor Detail

PersonFactory

public PersonFactory()
Creates a new instance of BuildPerson

Method Detail

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.