Here's some code from Clock.java that I was able to get running
Just need ClockShop.java ASAP please. Thank you!
ClockShop This class will hold an array of Clock objects. It will provide behaviors (methods) that allow for sorting, searching, retrieving, and printing the Clocks it contains. Specifics for this class are as follows: - Declare a private field that is an ArrayList of type Clock called myClocks - private ArrayList myClocks; - Include a default constructor (public ClockShop()) that is used to create an empty ArrayList of Clock and assign it to your myClocks field - Include a method called public void fillClockShop(final String thelnputFileName) which is passed the name of a file. The method opens the file specified in the parameter to the method for input. This file will contain times for clocks, one per line, in the following format: hour:minute:second (e.g. 11:29:45). There will be at least one entry in the file, guaranteed. Read through the file and fill myClocks with Clock objects initialized based on the values in the input file. NOTE: You can modify the Scanner object you are using to read from the file and use a colon ':' as the delimiter by calling the useDelimiter(String pattern) method on your Scanner if you wish. - Include a method called public void sortClocks that sorts the Clocks in ascending (smallest time to largest time) order. You must write the code to sort the array of Clocks (meaning calls to the Java API to do this are not allowed). Your sort code must utilize the compareTo method provided by the Clock class. - Include a method called public int findClock(final Clock theClock) that is passed a Clock object and checks to see if it exists in the Clock ArrayList. If it does exist, return the index of where the first one was found. If it does not exist, return a 1. - Include a public String toString method (which is an override of the toString method inherited from Object) that builds a String containing each Clock object in String format (via the toString in the Clock class) and returns that String. Each Clock object must be followed by a newline ( ). - Include a public Clock getClock(final int thelndex) method that is passed an integer index of which Clock to retrieve from the array of Clocks. If the index is outside the range of the array, throw an IllegalArgumentException. If the index falls within the array, return the Clock object at that index. - Include a public void setClock(final Clock theClock, final int thelndex) method that is passed a Clock object and an index. The method places the Clock object at the specified index in the array (replacing the Clock that was there before). If the index is outside the range of the array, throw an IllegalArgumentException. - Include a public void writeClocksToFile(final String theFilename) method that is passed the name of a file, opens a file by that name, then writes the contents of the array of Clocks to the file. It then closes the file. NOTE: take advantage of the toString method you wrote for this class