edu.pdx.cs399J.family
Class Marriage

java.lang.Object
  extended by edu.pdx.cs399J.family.Marriage
All Implemented Interfaces:
Serializable

public class Marriage
extends Object
implements 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:
Serialized Form

Constructor Summary
Marriage(Person husband, Person wife)
          Creates a marriage between a husband and a wife.
 
Method Summary
 Date getDate()
          Returns the date on which the husband and wife were married.
 Person getHusband()
          Returns the husband in this marriage.
 String getLocation()
          Returns the location at which the husband and wife were married.
 Person getWife()
          Returns the wife in this marriage.
 void setDate(Date date)
          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.
 String toString()
          Returns a brief description of this marriage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Marriage

public Marriage(Person husband,
                Person wife)
Creates a marriage between a husband and a wife. It is the responsibility of the caller to invoke Person.addMarriage(Marriage).

Throws:
IllegalArgumentException - The husband is not Person.MALE or the wife is not Person.FEMALE.
Method Detail

getHusband

public Person getHusband()
Returns the husband in this marriage.


getWife

public Person getWife()
Returns the wife in this marriage.


getDate

public Date getDate()
Returns the date on which the husband and wife were married.


setDate

public void setDate(Date date)
Sets the date on which the husband and wife were married.


getLocation

public String getLocation()
Returns the location at which the husband and wife were married.


setLocation

public void setLocation(String location)
Sets the location at which the husband and wife were married.


toString

public String toString()
Returns a brief description of this marriage.

Overrides:
toString in class Object


Copyright © 2000-2009 Portland State University. All Rights Reserved.