package edu.oakland.OUSoft.database;

import edu.oakland.OUSoft.items.Course;
import edu.oakland.OUSoft.items.Student;

/**
 * "contains at least two fields, one for referencing to the Course object and one referencing to the Student object.
 * Since we will build a linked list of the all enrollment objects,
 * you will add an “Enrollment link” filed in the Enrollment class, the same approach as the LLNode class in the textbook."
 */
public class Enrollment {
	
	private Course course;
	private Student student;
	
	private Enrollment link;
	
	/**
	 * Create a new Enrollment. Enrollments indicate a {@link Student} is enrolled in a {@link Course}.
	 *
	 * @param course The course of the Enrollment
	 * @param student The student of the Enrollment
	 */
	public Enrollment(Course course, Student student) {
		this.course = course;
		this.student = student;
	}
	
	public Course getCourse() {
		return course;
	}
	
	public void setCourse(Course course) {
		this.course = course;
	}
	
	public Student getStudent() {
		return student;
	}
	
	public void setStudent(Student student) {
		this.student = student;
	}
	
	public Enrollment getLink() {
		return link;
	}
	
	public void setLink(Enrollment link) {
		this.link = link;
	}
	
	@Override
	public String toString() {
		return "Enrollment of student " + this.student + " in course " + this.course;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Enrollment) {
			Enrollment check = (Enrollment) obj;
			return this.course.equals(check.getCourse()) && this.student.equals(check.getStudent());
		}
		return false;
	}
}

@@ -515,36 +515,8 @@
 ;%0A%09%0A
-%09private Enrollment link;%0A%09%0A
 %09/**
@@ -639,16 +639,17 @@
  course 
+ 
 The cour
@@ -1083,124 +1083,8 @@
 %7D%0A%09%0A
-%09public Enrollment getLink() %7B%0A%09%09return link;%0A%09%7D%0A%09%0A%09public void setLink(Enrollment link) %7B%0A%09%09this.link = link;%0A%09%7D%0A%09%0A
 %09@Ov

Remove link from enrollment for now