title: Appointment class
body: <p>I'm trying to create a method that would add an appointment to an arraylist appointmentCalndar. This method would validate the date to see if the user input is equal to the SimpleDateFormat in my code, the startTime and the endTime of the appointment and to see if its in the future or not. </p>
  
  <p>I have tried using the java Date api to check this but when I try to extend the class to get access to the attributes it always causes an error on compile time. So overall my question is what would the best way to compare an object of appointment type to an object of type date? I try using accesors to getDate() and startTime and endTime but it won't allow me to get them also.</p>
  
  <pre><code>public AppointmentDate(String appString)
  {
      // 1) split ithe string into Date/from/to
      // 2) consturct the Date object for the appDate
      // 3) consturct the Date object for the startTime
      // 4) consturct the Date object for the endTime
  
      String[] appDetails = appString.split(",");
  
      if(appDetails.length == 2)
      {
          try {
              SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
              this.appDate = df.parse(appDetails[0]);
              DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy,mm:HH");
              String dFormat = appDetails[0] + "," + appDetails[1];
              this.startTime = formatter.parse(dFormat);
              dFormat = appDetails[0] + "," + appDetails[2];
              this.endTime = formatter.parse(dFormat);
          }
          catch (Exception ex)
          {
  
          }
      }
  
      else 
      {
          System.out.print("User Date is Invalid");
      }
  }
  public void setStartTime(Date startTime) 
  {
      this.startTime = startTime;
  }
  
  public Date getStartTime()
  {
      return startTime;
  }
  
  public void setEndTime(Date endTime) 
  {
      this.endTime = endTime;
  }
  
  public Date getEndTime()
  {
      return endTime;
  }
  
  public void setAppdate(Date appDate) 
  {
      this.appDate = appDate;
  }
  
  public Date getAppDate()
  {
      return appDate;
  }
  
  
  public void add(Appointment a) 
  {
      if (a.equals(a.getDate()))
      {
          if(a.getStartTime() &lt; a.getEndTime())
          {
  
          }
      }
      else
      {
          System.out.print("");
      }
  
  }
  </code></pre>