// DataSet2D.java public class DataSet2D extends DataSet { public final static int SORT_NONE=0; public final static int SORT_X=1; public final static int SORT_Y=2; private int sort_order=SORT_NONE; public DataSet2D(int num,int incr) { super(num,incr); } public void SetSortOrder(int so) { if((so<0) || (so>2)) sort_order=SORT_NONE; sort_order=so; } public int GetSortOrder() { return(sort_order); } public void AddElement(Point2D p) { int i; switch(sort_order) { case SORT_NONE: data.addElement(p); break; case SORT_X: for(i=0; (i=data.size()) throw new DataSet.DataException("Element out of range"); return((Point2D)data.elementAt(i)); } public double Interpolate(double indep_var) throws InterpolationException { int i; if(sort_order==SORT_NONE) throw new InterpolationException("No sort order specified"); if(sort_order==SORT_X) { for(i=0; (i