university
Class Person

java.lang.Object
  extended by university.Person
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Employee, Student

public class Person
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Abstract class that represents people in the university.

See Also:
Serialized Form

Constructor Summary
Person()
          Creates a new instance of Person
Person(java.lang.String name, Sex gender, Address address, Unit unit)
          Creates a new instance of Person
 
Method Summary
 java.lang.Object clone()
          Clone a new object
 Address getAddress()
          Get the Address of the Person.
 Unit getAffiliation()
          Returns the unit a person belongs to.
 Sex getGender()
          Returns the sex of a person
 int getID()
          Returns the ID of a person.
 java.lang.String getName()
          Returns the name of a person
 void setName(java.lang.String name)
          Sets the persons name to a new name.
 java.lang.String toString()
          Returns the String representation of a person.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Person

public Person()
Creates a new instance of Person


Person

public Person(java.lang.String name,
              Sex gender,
              Address address,
              Unit unit)
Creates a new instance of Person

Parameters:
name - The name of the person
gender - The sex of the person
address - The address of the person
unit - The unit the person belongs to
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone a new object

Overrides:
clone in class java.lang.Object
Returns:
Object a cloned object
Throws:
java.lang.CloneNotSupportedException - Throws CloneNotSupportedException

getName

public final java.lang.String getName()
Returns the name of a person

Returns:
The name of the person

getGender

public final Sex getGender()
Returns the sex of a person

Returns:
The gender of the person

getAffiliation

public final Unit getAffiliation()
Returns the unit a person belongs to.

Returns:
The unit that the person belongs to

getID

public final int getID()
Returns the ID of a person.

Returns:
The ID of the person

getAddress

public final Address getAddress()
Get the Address of the Person.

Returns:
The Address of the Person.

setName

public final void setName(java.lang.String name)
Sets the persons name to a new name.

Parameters:
name - The new name for the person.

toString

public java.lang.String toString()
Returns the String representation of a person.

Overrides:
toString in class java.lang.Object
Returns:
A string representing the person