package ecoparasite.representation; import java.util.HashSet; import java.util.function.Function; public class ValeursXY { private double x; private double y; public ValeursXY(double x, double y){ this.x = x; this.y = y; } public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y; } public static HashSet convertToXY(HashSet list, Function getX, Function getY){ HashSet xy = new HashSet(); for(T item : list){ if(getX.apply(item) != null && getY.apply(item) != null){ xy.add( new ValeursXY(getX.apply(item).doubleValue(), getY.apply(item).doubleValue())); } } return xy; } /* public static ValeursXY getMinX( HashSet list ){ } */ }