// We store the element type as the type of the internal array.
// Disadvantage: Empty lists are a bit bigger.
// Methods will throw ArrayStoreException if trying to add
// element of wrong type.
persistable sclass SynchronizedTypedArrayList<A> extends Synchroni
zedArrayList_Base<A> implements RandomAccess, Cloneable {
private static final int DEFAULT_CAPACITY = 10;
transient Object[] elementData; // non-private to simplify
nested class access
private *() {} // for persistence only - sadly this doesn't
actually restrict access since we're an inner class
*(Class<A> elementType) {
*(Class<A> elementType, int initialCapacity) {
if (initialCapacity >= 0)
elementData = newArray(elementType, initialCapacity);
throw new IllegalArgumentException("Illegal Capacity: "+