All Packages Class Hierarchy This Package Previous Next Index
Class JBMSTours.serializabletypes.Adult
java.lang.Object
|
+----JBMSTours.serializabletypes.Person
|
+----JBMSTours.serializabletypes.Adult
- public class Adult
- extends Person
- implements Externalizable
Look at the Source.
An Adult is a subclass of a Person. Persons are members of groups.
This class illustrates how you can store a subclass--you can store any subclass
of Person in the People table.
This is a highly simplified example of a an object. Normally, if data is this
simple, store it as relational data.
Use INSTANCEOF CLASS.JBMSTours.serializabletypes.Adult to select only members of the subclass.
Persons get stored in the People Table.
BuildATour constructs the People objects.
- See Also:
- BuildATour, Group, Person, Child
-
Adult()
-
-
Adult(String, String)
- Constructor.
-
Adult(String, String, char)
- Constructor.
-
getPassportNumber()
- Gets the passport number.
-
readExternal(ObjectInput)
-
-
setPassportNumber(String)
- Sets the passport number for main person in group only.
-
setPassportNumberReturnSelf(String)
- Sets the passport number for main person in group only, returns Object (for use in
update statements).
-
writeExternal(ObjectOutput)
-
Adult
public Adult()
Adult
public Adult(String first,
String last)
- Constructor.
Takes a first name and a last name.
- Parameters:
- first - the first name.
- last - the last name.
Adult
public Adult(String first,
String last,
char a)
- Constructor.
Takes a first name, a last name, and a middle initial.
- Parameters:
- first - thefirst name.
- last - the last name.
- a - the middle initial.
setPassportNumber
public void setPassportNumber(String number)
- Sets the passport number for main person in group only.
- Parameters:
- number - the passportNumber
setPassportNumberReturnSelf
public Person setPassportNumberReturnSelf(String number)
- Sets the passport number for main person in group only, returns Object (for use in
update statements). For example, with this method, you can do an
update like this:
Update people SET person = CAST (person AS CLASS JBMSTours.serializabletypes.Adult).setPassportNumberReturnSelf('ABCD') WHERE person_id = 2
- Parameters:
- number - the passportNumber
getPassportNumber
public String getPassportNumber()
- Gets the passport number.
- Returns:
- s the passport number, if the person has one. Otherwise returns unknown.
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Throws: IOException
- if failure to read
- Overrides:
- writeExternal in class Person
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Throws: IOException
- thrown on failure to read
- Throws: ClassNotFoundException
- thrown on failure to convert
- Overrides:
- readExternal in class Person
All Packages Class Hierarchy This Package Previous Next Index