@Test public void testSet() { list.add(asArray(0, 1, 2)); assertEquals2(0, list.set(0, k3)); assertEquals2(1, list.set(1, k4)); assertEquals2(2, list.set(2, k5)); assertListEquals(list.toArray(), 3, 4, 5); }
@Override public KType set(int index, KType e1) { assert (index >= 0 && index < size()) : "Index " + index + " out of bounds [" + 0 + ", " + size() + ")."; final KType v = Intrinsics.<KType> cast(buffer[index]); buffer[index] = e1; return v; }
KTypeArrayList extends AbstractKTypeCollection<KType> implements KTypeIndexedContainer<KType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public KType set(int index, KType e1) { assert (index >= 0 && index < size()) : "Index " + index + " out of bounds [" + 0 + ", " + size() + ")."; final KType v = Intrinsics.<KType> cast(buffer[index]); buffer[index] = e1; return v; } }
KTypeArrayList extends AbstractKTypeCollection<KType> implements KTypeIndexedContainer<KType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public KType set(int index, KType e1) { assert (index >= 0 && index < size()) : "Index " + index + " out of bounds [" + 0 + ", " + size() + ")."; final KType v = Intrinsics.<KType> cast(buffer[index]); buffer[index] = e1; return v; } KTypeArrayList();  KTypeArrayList(int expectedElements);  KTypeArrayList(int expectedElements, ArraySizingStrategy resizer);  KTypeArrayList(KTypeContainer<? extends KType> container); }
KTypeArrayList extends AbstractKTypeCollection<KType> implements KTypeIndexedContainer<KType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public KType set(int index, KType e1) { assert (index >= 0 && index < size()) : "Index " + index + " out of bounds [" + 0 + ", " + size() + ")."; final KType v = Intrinsics.<KType> cast(buffer[index]); buffer[index] = e1; return v; } KTypeArrayList();  KTypeArrayList(int expectedElements);  KTypeArrayList(int expectedElements, ArraySizingStrategy resizer);  KTypeArrayList(KTypeContainer<? extends KType> container); @Override void add(KType e1); void add(KType e1, KType e2); void add(KType[] elements, int start, int length); @SafeVarargs /* #end */ final void add(KType... elements); int addAll(KTypeContainer<? extends KType> container); int addAll(Iterable<? extends KTypeCursor<? extends KType>> iterable); @Override void insert(int index, KType e1); @Override KType get(int index); @Override KType set(int index, KType e1); @Override KType remove(int index); @Override void removeRange(int fromIndex, int toIndex); @Override int removeFirst(KType e1); @Override int removeLast(KType e1); @Override int removeAll(KType e1); @Override boolean contains(KType e1); @Override int indexOf(KType e1); @Override int lastIndexOf(KType e1); @Override boolean isEmpty(); @Override void ensureCapacity(int expectedElements); void resize(int newSize); @Override int size(); void trimToSize(); @Override void clear(); @Override void release(); @Override /*! #if ($TemplateOptions.KTypePrimitive) KType [] toArray() #else !*/ Object [] toArray(); @Override KTypeArrayList<KType> clone(); @Override int hashCode(); @Override boolean equals(Object obj); @Override long ramBytesAllocated(); @Override long ramBytesUsed(); @Override Iterator<KTypeCursor<KType>> iterator(); @Override T forEach(T procedure); T forEach(T procedure, int fromIndex, final int toIndex); @Override int removeAll(KTypePredicate<? super KType> predicate); @Override T forEach(T predicate); T forEach(T predicate, int fromIndex, final int toIndex); @SafeVarargs /* #end */ static KTypeArrayList<KType> from(KType... elements); }
KTypeArrayList extends AbstractKTypeCollection<KType> implements KTypeIndexedContainer<KType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public KType set(int index, KType e1) { assert (index >= 0 && index < size()) : "Index " + index + " out of bounds [" + 0 + ", " + size() + ")."; final KType v = Intrinsics.<KType> cast(buffer[index]); buffer[index] = e1; return v; } KTypeArrayList();  KTypeArrayList(int expectedElements);  KTypeArrayList(int expectedElements, ArraySizingStrategy resizer);  KTypeArrayList(KTypeContainer<? extends KType> container); @Override void add(KType e1); void add(KType e1, KType e2); void add(KType[] elements, int start, int length); @SafeVarargs /* #end */ final void add(KType... elements); int addAll(KTypeContainer<? extends KType> container); int addAll(Iterable<? extends KTypeCursor<? extends KType>> iterable); @Override void insert(int index, KType e1); @Override KType get(int index); @Override KType set(int index, KType e1); @Override KType remove(int index); @Override void removeRange(int fromIndex, int toIndex); @Override int removeFirst(KType e1); @Override int removeLast(KType e1); @Override int removeAll(KType e1); @Override boolean contains(KType e1); @Override int indexOf(KType e1); @Override int lastIndexOf(KType e1); @Override boolean isEmpty(); @Override void ensureCapacity(int expectedElements); void resize(int newSize); @Override int size(); void trimToSize(); @Override void clear(); @Override void release(); @Override /*! #if ($TemplateOptions.KTypePrimitive) KType [] toArray() #else !*/ Object [] toArray(); @Override KTypeArrayList<KType> clone(); @Override int hashCode(); @Override boolean equals(Object obj); @Override long ramBytesAllocated(); @Override long ramBytesUsed(); @Override Iterator<KTypeCursor<KType>> iterator(); @Override T forEach(T procedure); T forEach(T procedure, int fromIndex, final int toIndex); @Override int removeAll(KTypePredicate<? super KType> predicate); @Override T forEach(T predicate); T forEach(T predicate, int fromIndex, final int toIndex); @SafeVarargs /* #end */ static KTypeArrayList<KType> from(KType... elements); final static Object [] EMPTY_ARRAY; public Object [] buffer; public int elementsCount; }