package edu.oakland.OUSoft.items;

import edu.oakland.OUSoft.linkedList.LLNode;

import java.io.Serializable;
import java.time.LocalTime;

/**
 * "includes information for a course such as course name, instructor, class meeting time, etc.
 * The instructor field of a Course object should reference to a valid Instructor object."
 */
public class Course implements LLNode<Course>, Serializable {
	
	private Course link;
	
	private String ID;
	private String name;
	private Instructor instructor;
	
	private LocalTime timeStart;
	private LocalTime timeEnd;
	
	/**
	 * Create a new Course
	 *
	 * @param ID   the ID of the course
	 * @param name the name of the Course
	 */
	public Course(String ID, String name) {
		this.ID = ID;
		this.name = name;
	}
	
	/**
	 * Create a new Course
	 *
	 * @param ID         the ID of the course
	 * @param name       the name of the Course
	 * @param instructor the instructor of the course
	 */
	public Course(String ID, String name, Instructor instructor) {
		this.ID = ID;
		this.name = name;
		this.instructor = instructor;
	}
	
	public String getID() {
		return ID;
	}
	
	public void setID(String ID) {
		this.ID = ID;
	}
	
	@Override
	public String toString() {
		return this.ID +
		       ": " +
		       this.name +
		       ", Taught by " +
		       this.getInstructor().getFirstName() +
		       " " +
		       this.getInstructor().getLastName() +
		       ". " +
		       "Start: " +
		       timeStart.toString() +
		       " End: " +
		       timeEnd.toString();
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public Instructor getInstructor() {
		return instructor;
	}
	
	public void setInstructor(Instructor instructor) {
		this.instructor = instructor;
	}
	
	public LocalTime getTimeStart() {
		return timeStart;
	}
	
	public void setTimeStart(LocalTime timeStart) {
		this.timeStart = timeStart;
	}
	
	public LocalTime getTimeEnd() {
		return timeEnd;
	}
	
	public void setTimeEnd(LocalTime timeEnd) {
		this.timeEnd = timeEnd;
	}
	
	/**
	 * Get the link to the next object
	 *
	 * @return The next object in the list
	 */
	@Override
	public Course getLink() {
		return this.link;
	}
	
	/**
	 * Set the link to the next object
	 *
	 * @param Link The next object in the list
	 */
	@Override
	public void setLink(Course Link) {
		this.link = Link;
	}
}

@@ -130,16 +130,42 @@
 calTime;
+%0Aimport java.util.Objects;
 %0A%0A/**%0A *
@@ -1092,32 +1092,90 @@
 %0A%09%0A%09
-public String getID(
+@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09if (!(obj instanceof Course)
 ) %7B%0A
+%09
 %09%09re
@@ -1183,63 +1183,287 @@
 urn 
-ID
+false
 ;%0A
+%09
 %09%7D%0A%09
-%0A%09public void setID(String ID) %7B%0A%09%09this.ID = ID
+%09Course o = (Course) obj;%0A%09%09return this.ID.equals(o.ID) &&%0A%09%09       Objects.equals(this.name, o.name) &&%0A%09%09       Objects.equals(this.instructor, o.instructor) &&%0A%09%09       Objects.equals(this.timeStart, o.timeStart) &&%0A%09%09       Objects.equals(this.timeEnd, o.timeEnd)
 ;%0A%09%7D
@@ -1779,24 +1779,24 @@
  %22 End: %22 +%0A
-
 %09%09       tim
@@ -1813,24 +1813,120 @@
 ing();%0A%09%7D%0A%09%0A
+%09public String getID() %7B%0A%09%09return ID;%0A%09%7D%0A%09%0A%09public void setID(String ID) %7B%0A%09%09this.ID = ID;%0A%09%7D%0A%09%0A
 %09public Stri

Implement equals() in Course