Advertisement
FenrirsCode

Reservation

May 26th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. /*
  2. * Reservation.java
  3. */
  4. package SortingFiles;
  5.  
  6. import Calendar.DateAD;
  7. import java.io.Serializable;
  8.  
  9.  
  10.  
  11.  
  12. /**
  13. *
  14. * @author Mathew Harmon
  15. */
  16.  
  17. public class Reservation implements Serializable, Comparable
  18. {
  19. //constructor with a String parameter and two DateAD parameters
  20. public Reservation(String name, DateAD arrival, DateAD departure){
  21. this.arrival = arrival;
  22. this.departure = departure;
  23. this.name = name;
  24. //need to do: sets DateAD properties to copies &
  25. //make it so departure date is not after -
  26. // - the arrival date, sets it to the day after the arrival
  27. }
  28. //Accessor for Arrival
  29. public DateAD getArrival(){
  30. return arrival;
  31. }
  32. //Accessor for Departure
  33. public DateAD getDeparture(){
  34. return departure;
  35. }
  36. //Accessor for Name
  37. public String getName(){
  38. return name;
  39. }
  40.  
  41. @Override
  42. public String toString(){
  43. return ( name + arrival + departure + " ");
  44. //might work... we see
  45. }
  46. /**
  47. *
  48. * @return
  49. */
  50. public String equals(){
  51. //need to write code here!
  52. return "";
  53. }
  54. @Override
  55. public int compareTo(Object t)throws java.lang.ClassCastException
  56. {
  57. //still needs code!
  58.  
  59. return 0;
  60. }
  61. String name = "";
  62. DateAD arrival;
  63. DateAD departure;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement