Question: JAVA QUESTION! ONLY NEED HELP WITH WRITING BOTH CLASSES! THANK YOU DataSetlist class The DataSetlist class should be used to store all the DataSet objects.

JAVA QUESTION! ONLY NEED HELP WITH WRITING BOTH CLASSES! THANK YOU

JAVA QUESTION! ONLY NEED HELP WITH WRITING BOTH CLASSES! THANK YOU DataSetlist

class The DataSetlist class should be used to store all the DataSet

DataSetlist class The DataSetlist class should be used to store all the DataSet objects. This class should inherit from the ArrayList class. The class needs to provide a default constructor that creates an empty DataSetlist object. In addition, the class should implement the following two methods: public DataSetlist getByTitle ( String keyword ) This method should return a list of all DataSet objects for which the titles (headlines) contain the keyword. The keyword comparison should be done in a case insensitive way. The returned list should be sorted according to the natural ordering of the elements (i.e., dictated by the compare to method defined in the Dataset class). If keyword is null or an empty string, this method should throw an instance of IllegalArgumentException with an appropriate message. If there are no elements in the list that match the given criteria, this method should return null. public DataSetlist getByDescription ( String keyword ) This method should return a list of all DataSet objects for which the descriptions (text fields) contain the keyword. The keyword comparison should be done in a case insensitive way. The returned list should be sorted according to the natural ordering of the elements (i.e., dictated by the compareto method defined in the Dataset class). If keyword is null or an empty string, this method should throw an instance of IllegalArgumentException with an appropriate message. If there are no elements in the list that match the given criteria, this method should return null. public DataSetlist getByURL ( String keyword ) This method should return a list of all Dataset objects for which the links contain the keyword. The keyword comparison should be done in a case insensitive way. The returned list should be sorted according to the natural ordering of the elements (i.e., dictated by the compare to method defined in the DataSet class). If keyword is null or an empty string, this method should throw an instance of IllegalArgumentException with an appropriate message. If there are no elements in the list that match the given criteria, this method should return null. DataSet class This class should represent a data set with all of its characteristics (date, title/headline, description/text, list of links, and any other information you may decide may be useful to store). This class should provide a three parameter constructor that validates and sets the title, description and a list of links. public DataSet (String title, String description, ArrayList links) Any non-empty string is a valid title or description. If this constructor is called with a null or an empty title or description, it should throw an instance of IllegalArgumentException with an appropriate message. links should be a non-empty list of URL objects. Note that URL is a class defined in Java (you do not need to define it yourself). If this constructor is called with a null or an empty list as links, it should throw an instance of the IllegalArgumentException with an appropriate message. There should be no default constructor. This class should provide the following mutator and accessor methods. The mutator methods should validate the data according to the specification below. If any values are invalid, the method should throw an instance of IllegalArgumentException with an appropriate message. o public void setDate(Date date), public Date getDate() - a valid date should not be null and should have a year equal to or after the year 2000. o public void setHatTips( String hatTips), public String getHatTips () - a valid hatTip not null string (hat- tips are missing for many of the entries in the data set, so they could be and empty string; if the hat-tip was never set or it was set to an empty string, the getHatTips method should return an empty string) The class should implement comparable interface. The two Dataset objects should be compared based on their dates, and, if the dates are the same or missing (if the date is not set in either of the compared objects), by their titles. The comparison between titles should be case insensitive. The class should override the equals method from the object class. Two DataSet objects are the same if they have identical dates and titles (case of letters does not matter). The class should override the toString method from the object class. It should return a multi-line String matching the following pattern DATE NAME DESCRIPTION LINKS DataSetlist class The DataSetlist class should be used to store all the DataSet objects. This class should inherit from the ArrayList class. The class needs to provide a default constructor that creates an empty DataSetlist object. In addition, the class should implement the following two methods: public DataSetlist getByTitle ( String keyword ) This method should return a list of all DataSet objects for which the titles (headlines) contain the keyword. The keyword comparison should be done in a case insensitive way. The returned list should be sorted according to the natural ordering of the elements (i.e., dictated by the compare to method defined in the Dataset class). If keyword is null or an empty string, this method should throw an instance of IllegalArgumentException with an appropriate message. If there are no elements in the list that match the given criteria, this method should return null. public DataSetlist getByDescription ( String keyword ) This method should return a list of all DataSet objects for which the descriptions (text fields) contain the keyword. The keyword comparison should be done in a case insensitive way. The returned list should be sorted according to the natural ordering of the elements (i.e., dictated by the compareto method defined in the Dataset class). If keyword is null or an empty string, this method should throw an instance of IllegalArgumentException with an appropriate message. If there are no elements in the list that match the given criteria, this method should return null. public DataSetlist getByURL ( String keyword ) This method should return a list of all Dataset objects for which the links contain the keyword. The keyword comparison should be done in a case insensitive way. The returned list should be sorted according to the natural ordering of the elements (i.e., dictated by the compare to method defined in the DataSet class). If keyword is null or an empty string, this method should throw an instance of IllegalArgumentException with an appropriate message. If there are no elements in the list that match the given criteria, this method should return null. DataSet class This class should represent a data set with all of its characteristics (date, title/headline, description/text, list of links, and any other information you may decide may be useful to store). This class should provide a three parameter constructor that validates and sets the title, description and a list of links. public DataSet (String title, String description, ArrayList links) Any non-empty string is a valid title or description. If this constructor is called with a null or an empty title or description, it should throw an instance of IllegalArgumentException with an appropriate message. links should be a non-empty list of URL objects. Note that URL is a class defined in Java (you do not need to define it yourself). If this constructor is called with a null or an empty list as links, it should throw an instance of the IllegalArgumentException with an appropriate message. There should be no default constructor. This class should provide the following mutator and accessor methods. The mutator methods should validate the data according to the specification below. If any values are invalid, the method should throw an instance of IllegalArgumentException with an appropriate message. o public void setDate(Date date), public Date getDate() - a valid date should not be null and should have a year equal to or after the year 2000. o public void setHatTips( String hatTips), public String getHatTips () - a valid hatTip not null string (hat- tips are missing for many of the entries in the data set, so they could be and empty string; if the hat-tip was never set or it was set to an empty string, the getHatTips method should return an empty string) The class should implement comparable interface. The two Dataset objects should be compared based on their dates, and, if the dates are the same or missing (if the date is not set in either of the compared objects), by their titles. The comparison between titles should be case insensitive. The class should override the equals method from the object class. Two DataSet objects are the same if they have identical dates and titles (case of letters does not matter). The class should override the toString method from the object class. It should return a multi-line String matching the following pattern DATE NAME DESCRIPTION LINKS

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!