Implement ArrayList#ensureCapacity

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2013-11-01 20:33:27 -05:00
parent eab3b8e448
commit 46a55bd024

View File

@ -65,6 +65,10 @@ public class ArrayList<T> extends AbstractList<T> implements java.io.Serializabl
return size;
}
public void ensureCapacity(int capacity) {
grow(capacity);
}
public boolean contains(Object element) {
for (int i = 0; i < size; ++i) {
if (equal(element, array[i])) {