Lines Matching refs:size

37  * this class provides methods to manipulate the size of the array that is
41 * <p>The <tt>size</tt>, <tt>isEmpty</tt>, <tt>get</tt>, <tt>set</tt>,
49 * the size of the array used to store the elements in the list. It is always
50 * at least as large as the list size. As elements are added to an ArrayList,
151 * The size of the ArrayList (the number of elements it contains).
155 private int size;
192 if ((size = elementData.length) != 0) {
195 elementData = Arrays.copyOf(elementData, size, Object[].class);
204 * list's current size. An application can use this operation to minimize
209 if (size < elementData.length) {
210 elementData = (size == 0)
212 : Arrays.copyOf(elementData, size);
225 // any size if not default element table
228 // supposed to be at default size.
253 * The maximum size of array to allocate.
256 * OutOfMemoryError: Requested array size exceeds VM limit
274 // minCapacity is usually close to size, so this is a win:
291 public int size() {
292 return size;
301 return size == 0;
326 for (int i = 0; i < size; i++)
330 for (int i = 0; i < size; i++)
346 for (int i = size-1; i >= 0; i--)
350 for (int i = size-1; i >= 0; i--)
366 v.elementData = Arrays.copyOf(elementData, size);
390 return Arrays.copyOf(elementData, size);
398 * allocated with the runtime type of the specified array and the size of
419 if (a.length < size)
421 return (T[]) Arrays.copyOf(elementData, size, a.getClass());
422 System.arraycopy(elementData, 0, a, 0, size);
423 if (a.length > size)
424 a[size] = null;
436 if (index >= size)
452 if (index >= size)
467 ensureCapacityInternal(size + 1); // Increments modCount!!
468 elementData[size++] = e;
482 if (index > size || index < 0)
485 ensureCapacityInternal(size + 1); // Increments modCount!!
487 size - index);
489 size++;
502 if (index >= size)
508 int numMoved = size - index - 1;
512 elementData[--size] = null; // clear to let GC do its work
532 for (int index = 0; index < size; index++)
538 for (int index = 0; index < size; index++)
553 int numMoved = size - index - 1;
557 elementData[--size] = null; // clear to let GC do its work
568 for (int i = 0; i < size; i++)
571 size = 0;
590 ensureCapacityInternal(size + numNew); // Increments modCount
591 System.arraycopy(a, 0, elementData, size, numNew);
592 size += numNew;
612 if (index > size || index < 0)
617 ensureCapacityInternal(size + numNew); // Increments modCount
619 int numMoved = size - index;
625 size += numNew;
639 * fromIndex >= size() ||
640 * toIndex > size() ||
645 // All the other cases (negative indices, or indices greater than the size
652 int numMoved = size - toIndex;
657 int newSize = size - (toIndex-fromIndex);
658 for (int i = newSize; i < size; i++) {
661 size = newSize;
670 return "Index: "+index+", Size: "+size;
719 for (; r < size; r++)
725 if (r != size) {
728 size - r);
729 w += size - r;
731 if (w != size) {
733 for (int i = w; i < size; i++)
735 modCount += size - w;
736 size = w;
757 // Write out size as capacity for behavioural compatibility with clone()
758 s.writeInt(size);
761 for (int i=0; i<size; i++) {
778 // Read in size, and any hidden stuff
784 if (size > 0) {
785 // be like clone(), allocate array based upon size not capacity
786 ensureCapacityInternal(size);
790 for (int i=0; i<size; i++) {
809 if (index < 0 || index > size)
842 // The "limit" of this iterator. This is the size of the list at the time the
847 protected int limit = ArrayList.this.size;
892 final int size = ArrayList.this.size;
894 if (i >= size) {
901 while (i != size && modCount == expectedModCount) {
1001 * those that change the size of this list, or otherwise perturb it in such
1008 subListRangeCheck(fromIndex, toIndex, size);
1012 static void subListRangeCheck(int fromIndex, int toIndex, int size) {
1015 if (toIndex > size)
1026 int size;
1033 this.size = toIndex - fromIndex;
1038 if (index < 0 || index >= this.size)
1048 if (index < 0 || index >= this.size)
1055 public int size() {
1058 return this.size;
1062 if (index < 0 || index > this.size)
1068 this.size++;
1072 if (index < 0 || index >= this.size)
1078 this.size--;
1088 this.size -= toIndex - fromIndex;
1092 return addAll(this.size, c);
1096 if (index < 0 || index > this.size)
1098 int cSize = c.size();
1106 this.size += cSize;
1117 if (index < 0 || index > this.size)
1127 return cursor != SubList.this.size;
1135 if (i >= SubList.this.size)
1165 final int size = SubList.this.size;
1167 if (i >= size) {
1174 while (i != size && modCount == expectedModCount) {
1238 subListRangeCheck(fromIndex, toIndex, size);
1243 return "Index: "+index+", Size: "+this.size;
1250 offset + this.size, this.modCount);
1260 final int size = this.size;
1261 for (int i=0; modCount == expectedModCount && i < size; i++) {
1314 * elementData array given its size(), that could only have
1339 private int getFence() { // initialize fence to size on first use
1347 hi = fence = lst.size;
1383 hi = lst.size;
1415 final BitSet removeSet = new BitSet(size);
1417 final int size = this.size;
1418 for (int i=0; modCount == expectedModCount && i < size; i++) {
1433 final int newSize = size - removeCount;
1434 for (int i=0, j=0; (i < size) && (j < newSize); i++, j++) {
1438 for (int k=newSize; k < size; k++) {
1441 this.size = newSize;
1456 final int size = this.size;
1457 for (int i=0; modCount == expectedModCount && i < size; i++) {
1470 Arrays.sort((E[]) elementData, 0, size, c);