import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

public class People implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private final String firstName;
	private final String name;
	private final Date birthday;
	private final People mother;
	private final People father;

	public People(String firstName, String name, int year, int month, int day, People mother, People father) {
		this.firstName = firstName;
		this.name = name;
		Calendar cal = Calendar.getInstance();
		cal.set(year, month, day);
		this.birthday = cal.getTime();
		this.mother = mother;
		this.father = father;
	}

	public final String firstName() {
		return firstName;
	}

	public final String name() {
		return name;
	}

	public final Date birthday() {
		return birthday;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append(firstName + " " + name + " " + birthday.toString());
		if (mother != null)
			sb.append(" mother: " + mother.firstName);
		if (father != null)
			sb.append(" father: " + father.firstName);
		return sb.toString();
	}
}
