/** * Lab #3 * CS 2334, Section 0?? * September 11, 2007 *

* This class models the movie ADT. *

* @author Group #? * @version 1.0 */ public class Movie /* */ { /** The title of the Movie represented by this class. */ private String title; /** The release date of the movie. */ private int year; /** * This is the default constructor for the class Movie. */ public Movie() { year = 0; title = ""; } /** * This is the constructor for the class Movie. * It instantiates the class with user supplied values. *

* @param title The title of the movie. * @param year The release date of the movie. */ public Movie(String title, int year) { this.title = new String( title ); this.year = year; } /** * Returns the title of the movie. *

* @return The title of the movie as a string. */ public String getName() { return title; } /** * This method returns the attributes of this movie as * a single string. *

* @return String representing the * contents of this object. */ public String toString() { // Add the code for toString() here. return Integer.toString(year); // Make sure you replace // this return statement. } /** * This method compares an instance of Movie with * this instance of Movie to see if they are equal. *

* Algorithm:
* ???? *

* @param obj The object we are comparing * this instance of Movie with. * @return Returns true if the two instances are * equal, false otherwise. */ public boolean equals( Object obj ) { // Add the code for equals() here. return true; // Make sure you replace this return statement. } /** * This method compares an instance of Movie with * this instance of Movie to determine their relationship. *

* Algorithm:
* ???? *

* @param other The object we are comparing * this instanceof Movie with. * @return ????????? */ public int compareTo( Object obj ) { // Add the code for compareTo() here. return (int)year; // Make sure you replace this // return statement. } }