mirror of
https://github.com/corda/corda.git
synced 2025-06-19 07:38:22 +00:00
Added ArrayList.set
This commit is contained in:
@ -100,6 +100,15 @@ public class ArrayList<T> implements List<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public T set(int index, T element) {
|
||||||
|
if (index >= size) {
|
||||||
|
resize(index+1);
|
||||||
|
}
|
||||||
|
Object oldValue = array[index];
|
||||||
|
array[index] = element;
|
||||||
|
return (T) oldValue;
|
||||||
|
}
|
||||||
|
|
||||||
public T remove(int index) {
|
public T remove(int index) {
|
||||||
T v = get(index);
|
T v = get(index);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user