package com.example.model;

/**
   An Event object represents a length of time on a specific day
   during which the user is busy. An Event has a day of the week,  
   start time, and an end time. 
   @author Ryan Whited and Chris Sobona
   @version 2006-3-18
*/

public class Event
{
  /**
     Default constructor - initializes data to 0   
  */
  public Event()
  {
    dayOfWeek = 0;
    startTime = 0;
    endTime = 0;
  }

  /**
     Constructor given a day id, start time, and end time
     @param id day of the week(Sunday = 0, Monday = 1, etc.)
     @param s start time
     @param e end time
  */
  public Event(int id, int s, int e)
  {
    this.dayOfWeek = id;
    this.startTime = s;
    this.endTime = e;
  }

  /** 
     @return the Event's day of the week
  */
  public int getID()
  {
    return this.dayOfWeek;
  } 

  /**
     @return the Event's start time
  */ 
  public int getStartTime()
  {
    return this.startTime;
  }

  /**
     @return the Event's end time
  */
  public int getEndTime()
  {
    return this.endTime;
  }

  /**
     @param t the Event's start time
  */
  public void setStartTime(int t)
  {
    this.startTime = t;
  }

  /** 
     @param t the Event's end time
  */
  public void setEndTime(int t)
  {
    this.endTime = t;
  }

  /**
     @param id the Event's day of the week
  */
  public void setDay(int id)
  {
    this.dayOfWeek = id;
  }

  /**
     Takes an Event, e, and returns true if e has the same day of the week,
     start time, and end time as the calling Event. Otherwise, returns false.
     @param e the Event
     @return true if the Events are equal, false otherwise
  */
  public boolean equals(Event e)
  {
    if(this.dayOfWeek == e.dayOfWeek &&
       this.startTime == e.startTime &&
       this.endTime == e.endTime)
         return true;
    else
      return false;
  }

  private int dayOfWeek;  // the Event's day of the week
  private int startTime;  // the Event's start time	
  private int endTime;    // the Event's end time
}
