import OOPLS.PointList;
import OOPLS.Point;
import java.util.Iterator;

public class PointListClient {
    public static void main(String args[]) {
        int [][] data = 
            {{345,78}, {890,987}, {23,56}, {0,700}};
        PointList pl = new PointList();
        for (int i=0; i<data.length; ++i)
            pl.push_back(new Point(data[i][0],data[i][1]));
        Point fp = pl.getFront(), bp = pl.getBack();
        System.out.println(
            "Front = (" + fp.x + ", " + fp.y + ")");
        System.out.println(
            "Back = (" + bp.x + ", " + bp.y + ")");
        System.out.print("All = ");
        Iterator<Point> i = pl.iterator();
        boolean first = true;
        while (i.hasNext()) {
            if (!first) System.out.print(", ");
            first = false;
            Point p = i.next();
            System.out.print("(" + p.x + ", " + p.y + ")");
        }
        System.out.println();
    }
}
