package lectures.arrays.collections_kinds;
import util.annotations.WebDocuments;

import lectures.graphics.ACartesianPoint;
import lectures.graphics.Point;


@WebDocuments({"Lectures/ArraysCollectionsKinds.pptx", "Lectures/ArraysCollectionsKinds.pdf", "Videos/ArraysCollectionsKinds.avi"})
public class APointHistory implements PointHistory /*, Serializable*/ {
    public final int MAX_SIZE = 50;
    protected Point[] contents = new Point[MAX_SIZE];
    protected int size = 0;
    public int size() {
        return size;
    }   
    public Point elementAt (int index) {
        return contents[index];
    }
    protected boolean isFull() {
        return size == MAX_SIZE;
    }
    public void addElement(int x, int y) {
        if (isFull())
            System.out.println("Adding item to a full history");
        else {
            Point p = new ACartesianPoint(x, y);
            contents[size] = p;
            size++;
        }
    }    
}