Merge pull request #233 from jentfoo/RandomAccess_implements

Small change to make these two structures implement RandomAccess
This commit is contained in:
Joshua Warner 2014-04-16 16:32:55 -06:00
commit a6f0923678
3 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class ArrayList<T> extends AbstractList<T> implements java.io.Serializable {
public class ArrayList<T> extends AbstractList<T> implements java.io.Serializable, RandomAccess {
private static final int MinimumCapacity = 16;
private Object[] array;

View File

@ -11,4 +11,6 @@
package java.util;
public interface RandomAccess {
/* nothing added here, this interface just indicates a
* structure is efficient to access via index's directly.*/
}

View File

@ -10,7 +10,7 @@
package java.util;
public class Vector<T> extends AbstractList<T> implements java.io.Serializable, Cloneable {
public class Vector<T> extends AbstractList<T> implements java.io.Serializable, Cloneable, RandomAccess {
private final ArrayList<T> list;
public Vector(int capacity) {