Paper Writing Services errors occur reading the file */ public static String[] sort(File[] files) throws IOException { String[] sortedData = new String[0]; for (File file

Abstract
throws IOException { throw new java.lang.IllegalStateException(“Method not implemented”); } /** * Given an array of files, ts method will return a sorted * list of the String data contained in each of the files. * * @param files the files to be read * @return the sorted data * @throws IOException thrown if any errors occur reading the

Other Requirements: import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; public class Sort { /** * You are to implement ts method. The method should invoke one or * more threads to read and sort the data from the collection of Files. * The method should return a sorted list of all of the String data * contained in the files. * * @param files * @return * @throws IOException */ public static String[] threadedSort(File[] files) throws IOException { throw new java.lang.IllegalStateException(“Method not implemented”); } /** * Given an array of files, ts method will return a sorted * list of the String data contained in each of the files. * * @param files the files to be read * @return the sorted data * @throws IOException thrown if any errors occur reading the file */ public static String[] sort(File[] files) throws IOException { String[] sortedData = new String[0]; for (File file : files) { String[] data = getData(file); data = MergeSort.mergeSort(data); sortedData = MergeSort.merge(sortedData, data); } return sortedData; } /** * Ts method will read in the string data from the specified * file and return the data as an array of String objects. * * @param file the file containing the String data * @return String array containing the String data * @throws IOException thrown if any errors occur reading the file */ private static String[] getData(File file) throws IOException { ArrayList data = new ArrayList(); BufferedReader in = new BufferedReader(new FileReader(file)); // Read the data from the file until the end of file is reached wle (true) { String line = in.readLine(); if (line == null) { // the end of file was reached break; } else { data.add(line); } } //Close the input stream and return the data in.close(); return data.toArray(new String[0]); } }

Sample references
  • (‘Harries, J. E., and J. M. Futyan. 2006. On the stability of the Earth’s radiative energy balance: Response to the Mt. Pinatubo eruption. Geophysical Research Letters 33:L23814, doi:10.1029/2006GL027457.’,)
  • (‘Melnyk, B.M.; Gallagher-Ford, L.; Long, L.E.; Fineout-Overholt, E. The establishment of evidence-based practice competencies forpracticing registered … (62 characters truncated) … ttings: Proficiencies to improve healthcarequality, reliability, patient outcomes, and costs. Worldviews Evid. Based Nurs. 2014, 11, 5–15. [CrossRef]’,)
  • (‘Cook, J. M., O’Donnell, C., Dinnen, S., Coyne, J. C., Ruzek, J. I., & Schnurr, P. P.(2012). Measurement of a model of implementation for health care: Toward atestable theory. Implementation Science, 7(1), 59.’,)
  • (‘Auld, G., L. H. Gulbrandsen, and C. L. McDermott. 2008. Certification schemes and the impacts on forests and forestry.Certification schemes and the impacts on forests and forestry. Annual Review of Environment and Resources 33:187-211.’,)

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer