|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectreservation.system.Person
This class hold person structure. This object could be asserted in the PersonList
.
Constructor Summary | |
(package private) |
Person()
Construct an empty person |
(package private) |
Person(java.lang.String personName,
Flight flight,
int bookingNumber,
Pos pos)
Construct a Person named personName booked on the flight the seat pos and has the booking number : bookingNumber . |
Method Summary | |
void |
_check()
Verify invariants : - regex ^[A-Z][a-z]*
- seat < dimension of the flight and > 0
|
protected java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
equals(java.lang.Object anObject)
Overide equals |
int |
getBookingNumber()
Return the booking number |
Flight |
getFlight()
Return the flight |
java.lang.String |
getPersonName()
Return the name of the person |
Pos |
getPos()
Return the position of the seat |
(package private) void |
setBookingNumber(int bookingNumber)
Set the booking number |
(package private) void |
setFlight(Flight flight)
Set the flight |
(package private) void |
setPersonName(java.lang.String personName)
Set the name of the person |
(package private) void |
setPos(Pos pos)
Set the position |
java.lang.String |
toString()
Returns a string representation of this Person object. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
Person()
Person(java.lang.String personName, Flight flight, int bookingNumber, Pos pos) throws java.lang.Exception
Person
named personName
booked on the flight
the seat pos
and has the booking number : bookingNumber
.
personName
- Name of the person.flight
- Flight on witch the person has booked.bookingNumber
- used to Identify
a group of personpos
- The position of the seat on the flight
java.lang.Exception
- if the invariant _check() is violatedMethod Detail |
void setPersonName(java.lang.String personName) throws java.lang.Exception
personName
- name of the person
java.lang.Exception
- if the invariant _check() is violatedvoid setFlight(Flight flight) throws java.lang.Exception
flight
- Flight on witch the person has booked.
java.lang.Exception
- if the invariant _check() is violatedvoid setBookingNumber(int bookingNumber) throws java.lang.Exception
bookingNumber
- the booking number
java.lang.Exception
- if the invariant _check() is violatedvoid setPos(Pos pos) throws java.lang.Exception
pos
- The position of the seat on the flight
java.lang.Exception
- if the invariant _check() is violatedpublic final java.lang.String getPersonName() throws java.lang.Exception
java.lang.Exception
- if the invariant _check() is violatedpublic final Flight getFlight() throws java.lang.Exception
java.lang.Exception
- if the invariant _check() is violatedpublic final int getBookingNumber() throws java.lang.Exception
java.lang.Exception
- if the invariant _check() is violatedpublic final Pos getPos() throws java.lang.Exception
Flight
java.lang.Exception
- if the invariant _check() is violatedpublic java.lang.String toString()
Person
object. This method
is intended to be used only for debugging purposes, and the content and format
of the returned string may vary between implementations. The returned string may
be empty but may not be null
Person
object.public boolean equals(java.lang.Object anObject)
anObject
- anObject
- the reference object with which to compare
true
if this object is the same as the obj argument or match a Profile
object;
false
otherwisepublic void _check() throws java.lang.Exception, java.lang.NullPointerException
- regex
^[A-Z][a-z]*
- seat < dimension of the flight and > 0
java.lang.NullPointerException
- if pos or name is null
java.lang.Exception
- if the invariant is violatedprotected java.lang.Object clone() throws java.lang.CloneNotSupportedException
Person
object
java.lang.CloneNotSupportedException
- if the object's class does not support the Cloneable
interface.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |