Question: (Translate to Eclipse code) Channel -name: String - shared boolean name String Channel name: String, size:int) + addPlaylist Playlist:boolean + deletePlaylist Playlist) boolean flipSharedStatusop Playlist):


Channel -name: String - shared boolean name String Channel name: String, size:int) + addPlaylist Playlist:boolean + deletePlaylist Playlist) boolean flipSharedStatusop Playlist): boolean + getPlaylis (Category Category) Playlist sortPiylists:void toString String Playlist Playlistname: String shared boolean, se adid Video Video) boolean remove Video Video) boolean + countVideosgory Category SortOnDuration: getString Shared boolean seShared shared bool) vold equals(objObjedoclean String: String Videos Vio cenumaration> Category COMEDY EDUCATION ENTERTAINMENT SPORTS OTHER - Song duration -category Category Video deng duration intory Category geturation: + getCategory Category quals Object) boolean 10 String: Video Class: Attributes: o id: the ID of the video o title: the title of the video o duration: the duration of the video in seconds o category: the category of the video Methods: Videoid:int, title:String, duration:int, category:Category): constructor o getDuration(): returns the duration in seconds of the video o getCategory(): returns the category of the video o equals(obj:Object): compares two objects of type Video based on their id and returns the result of the equality toString(: this method returns a string representation of the video Playlist Class: Attributes: o name: the name of the playlist o shared the sharing status of the playlist; true if it's public and false if it's private Methods: Playlist(): default constructor for an empty playlist o Playlist(name:String, shared:boolean, size:int): constructor o addVideo(v:Video): adds a video to the playlist if there's space and the video wasn't added before o remove Video(v:Video): removes a video from the playlist if it's there while maintaining the order of the playlist o countVideosOf(category:Category): returns the number of videos of a certain category currently in the playlist o sortOnDuration(): sorts the videos in the playlist ascendingly based on the duration getName(); returns the name of the playlist o isShared(): returns the shared status of the playlist o setShared(shared:boolean): sets the value of the shared status of the playlist o equals(obj:Object): compares two objects of type Playlist based on their name and returns the result of the equality o toString(): this method returns a string representation of the playlist Channel Class: Attributes: o name: the name of the channel Methods: o Channel(name:String, size:int): constructor o addPlaylist(p:Playlist): adds a playlist to the channel if there's space and the playlist wasn't added before o delete Playlist(p:Playlist): removes a playlist from the channel if it's there by replacing it with the last playlist in the channel flipSharedStatusOf(p:Playlist): flips the shared status of a playlist if it's there in channel o getPlaylist/category:Category): returns the playlist in the channel having the most videos of a certain category if possible o sortPlaylists(): sorts all videos in each playlist in the channel ascendingly based on duration o toString(): this method returns a string representation of the channel Exercise 1: Write the previous classes. Exercise 2: Write a main method that tests the functionalities of the previous classes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
