package ShapeListService; import java.util.Vector; public class ShapeListImpl implements ShapeList{ private Vector theList = new Vector(); private int version = 0; private Vector theVersions = new Vector(); public ShapeListImpl(){ version = 0; theVersions = new Vector(); } public int newShape(GraphicalObject g) { version++; theList.addElement(g); theVersions.addElement(new Integer(version)); return theList.size(); } public int numberOfShapes(){ return theList.size(); } public int getVersion() { return version; } public int getGOVersion(int i){ return ((Integer) theVersions.elementAt(i)).intValue(); } public GraphicalObject getAllState(int i) { return (GraphicalObject)theList.elementAt(i); } }