Question: The project's code distribution is available at TubeVideosManager.zip. You need the same username/password you use to download lecture slides. Download the code distribution and import

The project's code distribution is available at TubeVideosManager.zip. You need the same username/password you use to download lecture slides. Download the code distribution and import it as you have imported our class examples. The code distribution provides you with the following:

  • tubeVideosManager A package where you will find shells for classes you need to implement.
  • tests A package where you will find public tests and a shell file for student tests.
  • text files/directories Files providing input for public tests, and support directories will be found in the main project folder. Expected outputs for public tests will be found in the expectedResults folder. Results generated by your code when you run your public tests will be placed in the results folder.
  • tubeVideos Interface - Defines the functionality of the video manager

Method Descriptions are provided below.

Genre.java

public enum Genre { Comedy, Educational, Documentary, Music, FilmAnimation }

TubeVideosManagerInt.java is an interface for TubeVideosManager.

Playlist.java

* A playlist keeps tracks of titles and it has a name. An ArrayList of string * references stores titles.

public class Playlist { private String name; private ArrayList videoTitles; * Initializes playlist with the specified name and creates an empty ArrayList. * If the parameter is null or is a blank string (according to String class * isBlank() method) the method will throw an IllegalArgumentException (with any * message) and perform no processing.

public Playlist(String name) { }

/** * Get method for name * @return name string public String getName() { }

/** * Initializes the current object so changes to the current object will not * affect the parameter object. public Playlist(Playlist playlist) { }

/** * Provided; please don't modify. toString for class * @return string with object info */ public String toString() { String answer = "Playlist Name: " + name + " ";

answer += "VideoTitles: " + videoTitles;

return answer; }

/** * Adds the title to the Arraylist storing titles. We can add the same video * title several times. If the parameter is null or is a blank string (according * to String class isBlank() method) the method will throw an * IllegalArgumentException (with any message) and perform no processing. * @return true if title is added; false otherwise */ public boolean addToPlaylist(String videoTitle) { }

/** * Get method for the ArrayList of titles. You must avoid privacy leaks. * @return ArrayList with titles */ public ArrayList getPlaylistVideosTitles() { }

/** * Removes all instances of the title parameter from the ArrayList of titles. If * the parameter is null or is a blank string (according to String class * isBlank() method) the method will throw an IllegalArgumentException (with any * message) and perform no processing. * @return true if the ArrayList (videoTitles) was changed as a result of * calling this method and false otherwise. */ public boolean removeFromPlaylistAll(String videoTitle) { }

/** * Randomizes the list of titles using a random parameter and * Collections.shuffle. If the parameter is null, call Collections.shuffle with * just the ArrayList. */ public void shuffleVideoTitles(Random random) { } } Video.java

A video has a title, url, durationInMinutes and a genre. Comments about the * video are kept in an ArrayList (comments). For yooTube videos the url is the * one generated by the "Copy embed code" option. public class Video implements Comparable

/** * Initializes a video object. If any parameter is null or if a string parameter * is a blank (according to String class isBlank() method), the method will * throw an IllegalArgumentException (with any message) and perform no * processing. Also the same exception will be thrown if the duration is zero or * negative. public Video(String title, String url, int durationInMinutes, Genre videoGenre) { }

/** * Initializes the Video object so changes to the parameter do not affect the * current object. Your implementation must be efficient (avoid any unnecessary * copies). public Video(Video video) { }

/** * Get method for title * @return title string */ public String getTitle() { }

/** * Get method for url * @return url string */ public String getUrl() { }

/** * Get method for duration * @return duration */ public int getDurationInMinutes() { }

/** * Get method for video genre * @return string with genre */ public Genre getGenre() { }

/** * Provided; please don't modify. toString for class * @return string with object info */ public String toString() { String answer = "Title: " + "\"" + title + "\" ";

answer += "Url: " + url + " "; answer += "Duration (minutes): " + durationInMinutes + " "; answer += "Genre: " + videoGenre + " ";

return answer; }

/** * Adds specified comments to the video. If the parameter is null or is a blank * string (according to String class isBlank() method) the method will throw an * IllegalArgumentException (with any message) and perform no processing. * @return true if comments added; false otherwise */ public boolean addComments(String comments) { }

/** * Returns copy so changes to the copy does not affect the original. Your * implementation must be efficient (avoid any unnecessary copies). * @return ArrayList of strings */ public ArrayList getComments() { }

/** * Videos will be compared using title. If we were to sort an ArrayList of * Videos, they will appear in lexicographical (alphabetical) order (e.g, "A", * "B", "C"). * @return negative, 0, or positive value */ public int compareTo(Video video) { }

/** * Two Video objects are considered equal if they have the same title. Implement * the method using the instanceof operator rather than using getClass(). * @return true if objects are considered equal; false otherwise */ @Override public boolean equals(Object obj) { } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!