*
* @see java.util.Vector
*/
-public final class Vec implements Serializable {
+public final class Vec implements Serializable, Cloneable {
private Object[] store;
private int size = 0;
public Vec() { this(10); }
public Vec(int i) { store = new Object[i]; }
public Vec(int i, Object[] store) { size = i; this.store = store; }
-
+ public Vec(Vec old) {
+ store = new Object[old.store.length];
+ System.arraycopy(old.store, 0, store, 0, old.store.length);
+ this.size = old.size;
+ }
+
+ public Object clone() { return new Vec(this); }
private void grow() { grow(store.length * 2); }
private void grow(int newsize) {
Object[] newstore = new Object[newsize];