Großmarkt

market
Class UPerson

java.lang.Object
  |
  +--users.User
        |
        +--market.UPerson
All Implemented Interfaces:
Comparable, Serializable
Direct Known Subclasses:
UCustomer, UStaffer

public class UPerson
extends User

A person that interacts with the market. Can be a customer or an employee.

See Also:
Serialized Form

Field Summary
static String FRAU
           
static String HERR
           
 
Fields inherited from class users.User
DEFAULT_PASSWORD_GARBLER, m_lhListeners
 
Constructor Summary
UPerson(String userName)
          Creates a new person.
 
Method Summary
 int compareTo(Object o)
          Sets the default comparison order for UPersons to
 String getAdress()
          Gets the person's address.
 String getCity()
          Gets the city where the person lives.
 Calendar getDayOfRegistration()
          Gets the day the person has first had contact with the market.
 String getFirstName()
          Gets the person's forename.
 String getFullName()
          Gets the person's name.
 int getMonthsOfMembership()
          Returns the time in months the person has been part of the market, be it as customer or worker.
 int getPostcode()
          Gets the person's postcode.
 String getSalutation()
          Gets the person's salutation.
 String getStreet()
          Gets the street where the person lives.
 String getSurname()
          Gets the person's surname.
 String getTelephone()
          Gets the person's telephone number.
 void setAddress(String street, int postcode, String city)
          Sets the person's address.
 void setCity(String city)
          Sets the city where the person lives.
 void setFirstName(String firstName)
          Sets the person's forename.
 void setFullName(String salutation, String name, String firstName)
          Sets the person's name.
 void setPostcode(int postcode)
          Sets the person's postcode.
 void setSalutation(String salutation)
          Sets the person's salutation.
 void setStreet(String street)
          Sets the street where the person lives.
 void setSurname(String name)
          Sets the person's surname.
 void setTelephone(String telephone)
          Sets the person's telephone number.
 
Methods inherited from class users.User
addCapabilityDataListener, equals, fireCapabilitiesAdded, fireCapabilitiesReplaced, garblePassWD, getCapability, getCapabilityCheckBox, getCharFromString, getGlobalPassWDGarbler, getName, getStringFromChar, isPassWd, loggedOff, loggedOn, removeCapabilityDataListener, setCapabilities, setCapability, setGlobalPassWDGarbler, setPassWd, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HERR

public static String HERR

FRAU

public static String FRAU
Constructor Detail

UPerson

public UPerson(String userName)
Creates a new person.

Parameters:
userName - the person's ID.
Method Detail

setFullName

public void setFullName(String salutation,
                        String name,
                        String firstName)
Sets the person's name.

Parameters:
salutation - the person's salutation (Mr, Mrs)
name - the person's surname.
firstName - the person's forename.

setAddress

public void setAddress(String street,
                       int postcode,
                       String city)
Sets the person's address.


setTelephone

public void setTelephone(String telephone)
Sets the person's telephone number.


getFullName

public String getFullName()
Gets the person's name.

Returns:
the full name, containing salutation, forename and surname.

getAdress

public String getAdress()
Gets the person's address.

Returns:
the address, containing street, postcode and city.

getTelephone

public String getTelephone()
Gets the person's telephone number.

Returns:
the telephone number.

getSalutation

public String getSalutation()
Gets the person's salutation.

Returns:
the salutation.

setSalutation

public void setSalutation(String salutation)
Sets the person's salutation.

Parameters:
salutation - the salutation to be set.

getSurname

public String getSurname()
Gets the person's surname.

Returns:
the surname.

setSurname

public void setSurname(String name)
Sets the person's surname.

Parameters:
name - the surname to be set.

getFirstName

public String getFirstName()
Gets the person's forename.

Returns:
the forename.

setFirstName

public void setFirstName(String firstName)
Sets the person's forename.

Parameters:
firstName - the forename to be set.

getStreet

public String getStreet()
Gets the street where the person lives.

Returns:
the street.

setStreet

public void setStreet(String street)
Sets the street where the person lives.

Parameters:
street - the street to be set.

getPostcode

public int getPostcode()
Gets the person's postcode.

Returns:
the postcode.

setPostcode

public void setPostcode(int postcode)
Sets the person's postcode.

Parameters:
postcode - the postcode to be set.

getCity

public String getCity()
Gets the city where the person lives.

Returns:
the city.

setCity

public void setCity(String city)
Sets the city where the person lives.

Parameters:
city - the city.

getDayOfRegistration

public Calendar getDayOfRegistration()
Gets the day the person has first had contact with the market.
For customer this is the registration, for workers the day of employment.

Returns:
the date registration or employment.

getMonthsOfMembership

public int getMonthsOfMembership()
Returns the time in months the person has been part of the market, be it as customer or worker.

Returns:
the time of membership or employment.
See Also:
getDayOfRegistration()

compareTo

public int compareTo(Object o)
Sets the default comparison order for UPersons to

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class User

Großmarkt