Home | History | Annotate | Download | only in collect

Lines Matching refs:length

42    * Returns a new array of the given length with the specified component type.
45 * @param length the length of the new array
49 public static <T> T[] newArray(Class<T> type, int length) {
50 return (T[]) Array.newInstance(type, length);
54 * Returns a new array of the given length with the same type as a reference
58 * @param length the length of the new array
60 public static <T> T[] newArray(T[] reference, int length) {
61 return Platform.newArray(reference, length);
73 T[] result = newArray(type, first.length + second.length);
74 System.arraycopy(first, 0, result, 0, first.length);
75 System.arraycopy(second, 0, result, first.length, second.length);
89 T[] result = newArray(array, array.length + 1);
91 System.arraycopy(array, 0, result, 1, array.length);
105 T[] result = arraysCopyOf(array, array.length + 1);
106 result[array.length] = element;
114 original, 0, copy, 0, Math.min(original.length, newLength));
128 * This is useful in determining the length of the collection <i>only</i> if
144 if (array.length < size) {
148 if (array.length > size) {
162 * collection is set to {@code null}. This is useful in determining the length of the collection
166 checkPositionIndexes(offset, offset + len, src.length);
167 if (dst.length < len) {
169 } else if (dst.length > len) {
198 static Object[] copyAsObjectArray(Object[] elements, int offset, int length) {
199 checkPositionIndexes(offset, offset + length, elements.length);
200 if (length == 0) {
203 Object[] result = new Object[length];
204 System.arraycopy(elements, offset, result, 0, length);
226 return checkElementsNotNull(array, array.length);
229 static Object[] checkElementsNotNull(Object[] array, int length) {
230 for (int i = 0; i < length; i++) {