Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static ArrayList<Point> getInputPoints(String path) {
- try (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {
- ArrayList<Point> points = new ArrayList<>();
- String line;
- while ((line = br.readLine()) != null) {
- // process the line.
- String[] data = line.split(",");
- double x = Double.parseDouble(data[0].trim());
- double y = Double.parseDouble(data[1].trim());
- int color = Integer.parseInt(data[2].trim());
- points.add(new Point(x, y, color));
- }
- return points;
- } catch(Exception e) {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement