Home | History | Annotate | Download | only in res

Lines Matching refs:currentSize

34      * @param currentSize The number of elements in the array. Must be less than or equal to
40 public static <T> T[] append(T[] array, int currentSize, T element) {
41 assert currentSize <= array.length;
43 if (currentSize + 1 > array.length) {
45 growSize(currentSize));
46 System.arraycopy(array, 0, newArray, 0, currentSize);
49 array[currentSize] = element;
56 public static int[] append(int[] array, int currentSize, int element) {
57 assert currentSize <= array.length;
59 if (currentSize + 1 > array.length) {
60 int[] newArray = new int[growSize(currentSize)];
61 System.arraycopy(array, 0, newArray, 0, currentSize);
64 array[currentSize] = element;
71 public static long[] append(long[] array, int currentSize, long element) {
72 assert currentSize <= array.length;
74 if (currentSize + 1 > array.length) {
75 long[] newArray = new long[growSize(currentSize)];
76 System.arraycopy(array, 0, newArray, 0, currentSize);
79 array[currentSize] = element;
86 public static boolean[] append(boolean[] array, int currentSize, boolean element) {
87 assert currentSize <= array.length;
89 if (currentSize + 1 > array.length) {
90 boolean[] newArray = new boolean[growSize(currentSize)];
91 System.arraycopy(array, 0, newArray, 0, currentSize);
94 array[currentSize] = element;
103 * @param currentSize The number of elements in the array. Must be less than or equal to
109 public static <T> T[] insert(T[] array, int currentSize, int index, T element) {
110 assert currentSize <= array.length;
112 if (currentSize + 1 <= array.length) {
113 System.arraycopy(array, index, array, index + 1, currentSize - index);
119 growSize(currentSize));
129 public static int[] insert(int[] array, int currentSize, int index, int element) {
130 assert currentSize <= array.length;
132 if (currentSize + 1 <= array.length) {
133 System.arraycopy(array, index, array, index + 1, currentSize - index);
138 int[] newArray = new int[growSize(currentSize)];
148 public static long[] insert(long[] array, int currentSize, int index, long element) {
149 assert currentSize <= array.length;
151 if (currentSize + 1 <= array.length) {
152 System.arraycopy(array, index, array, index + 1, currentSize - index);
157 long[] newArray = new long[growSize(currentSize)];
167 public static boolean[] insert(boolean[] array, int currentSize, int index, boolean element) {
168 assert currentSize <= array.length;
170 if (currentSize + 1 <= array.length) {
171 System.arraycopy(array, index, array, index + 1, currentSize - index);
176 boolean[] newArray = new boolean[growSize(currentSize)];
188 public static int growSize(int currentSize) {
189 return currentSize <= 4 ? 8 : currentSize * 2;