Package edu.pdx.cs410J.family
Class Marriage
java.lang.Object
edu.pdx.cs410J.family.Marriage
- All Implemented Interfaces:
Serializable
This class represents a marriage between two people. Ain't love
grand? Each marriage consists of a husband, a wife, a date, and a
location.
- Author:
- David Whitlock
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDate()
Returns the date on which the husband and wife were married.Returns the husband in this marriage.Returns the location at which the husband and wife were married.getWife()
Returns the wife in this marriage.void
Sets the date on which the husband and wife were married.void
setLocation
(String location) Sets the location at which the husband and wife were married.toString()
Returns a brief description of this marriage.
-
Constructor Details
-
Marriage
Creates a marriage between a husband and a wife. It is the responsibility of the caller to invokePerson.addMarriage(Marriage)
.- Throws:
IllegalArgumentException
- Thehusband
is notPerson.MALE
or thewife
is notPerson.FEMALE
.
-
-
Method Details
-
getHusband
Returns the husband in this marriage. -
getWife
Returns the wife in this marriage. -
getDate
Returns the date on which the husband and wife were married. -
setDate
Sets the date on which the husband and wife were married. -
getLocation
Returns the location at which the husband and wife were married. -
setLocation
Sets the location at which the husband and wife were married. -
toString
Returns a brief description of this marriage.
-