package Sorting;

import java.util.ArrayList;
import java.lang.Integer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.io.BufferedReader;
import java.io.IOException;

class RandomNumberFileReader{
	
	private ArrayList<Integer> numbers = new ArrayList<Integer>();

	public RandomNumberFileReader(String file){
		//Reads in from a text file of integers, one on each line
		try{
			BufferedReader reader = Files.newBufferedReader(Path.of(file));
			String line = null;
			while((line = reader.readLine())!=null){
				numbers.add(Integer.parseInt(line));
			}
			reader.close();
		} catch (IOException ex){
			System.err.println(ex);
		}
	}
	
	public ArrayList<Integer> getNumbers(){
		return numbers;
	}


}
