SmartList implements RandomAccess

This commit is contained in:
Sergey Simonchik
2015-05-28 13:26:40 +03:00
parent dd52332925
commit 6bf14193cb
@@ -27,7 +27,7 @@ import java.util.*;
* in which cases it would not allocate array at all.
*/
@SuppressWarnings({"unchecked"})
public class SmartList<E> extends AbstractList<E> {
public class SmartList<E> extends AbstractList<E> implements RandomAccess {
private int mySize = 0;
private Object myElem = null; // null if mySize==0, (E)elem if mySize==1, Object[] if mySize>=2