Lines Matching refs:size

32  * this class provides methods to manipulate the size of the array that is
36 * <p>The <tt>size</tt>, <tt>isEmpty</tt>, <tt>get</tt>, <tt>set</tt>,
44 * the size of the array used to store the elements in the list. It is always
45 * at least as large as the list size. As elements are added to an ArrayList,
126 * The size of the ArrayList (the number of elements it contains).
130 private int size;
165 size = elementData.length;
168 elementData = Arrays.copyOf(elementData, size, Object[].class);
173 * list's current size. An application can use this operation to minimize
178 if (size < elementData.length) {
179 elementData = Arrays.copyOf(elementData, size);
192 // any size if real element table
195 // at default size.
220 * The maximum size of array to allocate.
223 * OutOfMemoryError: Requested array size exceeds VM limit
241 // minCapacity is usually close to size, so this is a win:
258 public int size() {
259 return size;
268 return size == 0;
293 for (int i = 0; i < size; i++)
297 for (int i = 0; i < size; i++)
313 for (int i = size-1; i >= 0; i--)
317 for (int i = size-1; i >= 0; i--)
334 v.elementData = Arrays.copyOf(elementData, size);
358 return Arrays.copyOf(elementData, size);
366 * allocated with the runtime type of the specified array and the size of
387 if (a.length < size)
389 return (T[]) Arrays.copyOf(elementData, size, a.getClass());
390 System.arraycopy(elementData, 0, a, 0, size);
391 if (a.length > size)
392 a[size] = null;
440 ensureCapacityInternal(size + 1); // Increments modCount!!
441 elementData[size++] = e;
457 ensureCapacityInternal(size + 1); // Increments modCount!!
459 size - index);
461 size++;
479 int numMoved = size - index - 1;
483 elementData[--size] = null; // clear to let GC do its work
503 for (int index = 0; index < size; index++)
509 for (int index = 0; index < size; index++)
524 int numMoved = size - index - 1;
528 elementData[--size] = null; // clear to let GC do its work
539 for (int i = 0; i < size; i++)
542 size = 0;
561 ensureCapacityInternal(size + numNew); // Increments modCount
562 System.arraycopy(a, 0, elementData, size, numNew);
563 size += numNew;
587 ensureCapacityInternal(size + numNew); // Increments modCount
589 int numMoved = size - index;
595 size += numNew;
609 * fromIndex >= size() ||
610 * toIndex > size() ||
615 int numMoved = size - toIndex;
620 int newSize = size - (toIndex-fromIndex);
621 for (int i = newSize; i < size; i++) {
624 size = newSize;
634 if (index >= size)
642 if (index > size || index < 0)
652 return "Index: "+index+", Size: "+size;
699 for (; r < size; r++)
705 if (r != size) {
708 size - r);
709 w += size - r;
711 if (w != size) {
713 for (int i = w; i < size; i++)
715 modCount += size - w;
716 size = w;
737 // Write out size as capacity for behavioural compatibility with clone()
738 s.writeInt(size);
741 for (int i=0; i<size; i++) {
758 // Read in size, and any hidden stuff
764 if (size > 0) {
765 // be like clone(), allocate array based upon size not capacity
766 ensureCapacityInternal(size);
770 for (int i=0; i<size; i++) {
789 if (index < 0 || index > size)
826 return cursor != size;
833 if (i >= size)
947 * those that change the size of this list, or otherwise perturb it in such
954 subListRangeCheck(fromIndex, toIndex, size);
958 static void subListRangeCheck(int fromIndex, int toIndex, int size) {
961 if (toIndex > size)
972 int size;
979 this.size = toIndex - fromIndex;
997 public int size() {
999 return this.size;
1007 this.size++;
1015 this.size--;
1024 this.size -= toIndex - fromIndex;
1028 return addAll(this.size, c);
1033 int cSize = c.size();
1040 this.size += cSize;
1059 return cursor != SubList.this.size;
1066 if (i >= SubList.this.size)
1149 subListRangeCheck(fromIndex, toIndex, size);
1154 if (index < 0 || index >= this.size)
1159 if (index < 0 || index > this.size)
1164 return "Index: "+index+", Size: "+this.size;