Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Reservation.java
- */
- package SortingFiles;
- import Calendar.DateAD;
- import java.io.Serializable;
- /**
- *
- * @author Mathew Harmon
- */
- public class Reservation implements Serializable, Comparable
- {
- //constructor with a String parameter and two DateAD parameters
- public Reservation(String name, DateAD arrival, DateAD departure){
- this.arrival = arrival;
- this.departure = departure;
- this.name = name;
- //need to do: sets DateAD properties to copies &
- //make it so departure date is not after -
- // - the arrival date, sets it to the day after the arrival
- }
- //Accessor for Arrival
- public DateAD getArrival(){
- return arrival;
- }
- //Accessor for Departure
- public DateAD getDeparture(){
- return departure;
- }
- //Accessor for Name
- public String getName(){
- return name;
- }
- @Override
- public String toString(){
- return ( name + arrival + departure + " ");
- //might work... we see
- }
- /**
- *
- * @return
- */
- public String equals(){
- //need to write code here!
- return "";
- }
- @Override
- public int compareTo(Object t)throws java.lang.ClassCastException
- {
- //still needs code!
- return 0;
- }
- String name = "";
- DateAD arrival;
- DateAD departure;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement