Lines Matching defs:arrayType

797      * by a single array parameter of type {@code arrayType}.
865 * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments
869 * @throws NullPointerException if {@code arrayType} is a null reference
870 * @throws IllegalArgumentException if {@code arrayType} is not an array type,
879 public MethodHandle asSpreader(Class<?> arrayType, int arrayLength) {
880 return asSpreader(type().parameterCount() - arrayLength, arrayType, arrayLength);
888 * are replaced by a single array parameter of type {@code arrayType}.
904 * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments
908 * @throws NullPointerException if {@code arrayType} is a null reference
909 * @throws IllegalArgumentException if {@code arrayType} is not an array type,
922 public MethodHandle asSpreader(int spreadArgPos, Class<?> arrayType, int arrayLength) {
923 MethodType postSpreadType = asSpreaderChecks(arrayType, spreadArgPos, arrayLength);
926 LambdaForm lform = mh.editor().spreadArgumentsForm(1 + spreadArgPos, arrayType, arrayLength);
927 MethodType preSpreadType = postSpreadType.replaceParameterTypes(spreadArgPos, spreadArgPos + arrayLength, arrayType);
935 private MethodType asSpreaderChecks(Class<?> arrayType, int pos, int arrayLength) {
936 spreadArrayChecks(arrayType, arrayLength);
943 Class<?> arrayElement = arrayType.getComponentType();
957 MethodType needType = mtype.asSpreaderType(arrayType, pos, arrayLength);
964 private void spreadArrayChecks(Class<?> arrayType, int arrayLength) {
965 Class<?> arrayElement = arrayType.getComponentType();
967 throw newIllegalArgumentException("not an array type", arrayType);
1014 * parameter (usually of type {@code arrayType}) is replaced by
1015 * {@code arrayLength} parameters whose type is element type of {@code arrayType}.
1022 * arguments by a single new array of type {@code arrayType}, whose elements
1029 * (<em>Note:</em> The {@code arrayType} is often identical to the last
1047 // arrayType can be a subtype of Object[]
1056 // arrayType can be any primitive array type
1069 * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
1073 * @throws NullPointerException if {@code arrayType} is a null reference
1074 * @throws IllegalArgumentException if {@code arrayType} is not an array type
1075 * or {@code arrayType} is not assignable to this method handle's trailing parameter type,
1083 public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
1084 return asCollector(type().parameterCount() - 1, arrayType, arrayLength);
1091 * except that the parameter at the position indicated by {@code collectArgPos} (usually of type {@code arrayType})
1092 * is replaced by {@code arrayLength} parameters whose type is element type of {@code arrayType}.
1114 * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
1118 * @throws NullPointerException if {@code arrayType} is a null reference
1119 * @throws IllegalArgumentException if {@code arrayType} is not an array type
1120 * or {@code arrayType} is not assignable to this method handle's array parameter type,
1130 public MethodHandle asCollector(int collectArgPos, Class<?> arrayType, int arrayLength) {
1131 asCollectorChecks(arrayType, collectArgPos, arrayLength);
1133 MethodType resultType = type().asCollectorType(arrayType, collectArgPos, arrayLength);
1134 MethodHandle newArray = MethodHandleImpl.varargsArray(arrayType, arrayLength);
1145 * Return false if the last parameter is not an exact match to arrayType.
1147 /*non-public*/ boolean asCollectorChecks(Class<?> arrayType, int pos, int arrayLength) {
1148 spreadArrayChecks(arrayType, arrayLength);
1155 if (param == arrayType) return true;
1156 if (param.isAssignableFrom(arrayType)) return false;
1158 throw newIllegalArgumentException("array type not assignable to argument", this, arrayType);
1172 * {@code arrayType}, even if the target has a different
1177 * is identical to {@code arrayType}.
1202 * a new array of type {@code arrayType}, whose elements
1301 * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
1304 * @throws NullPointerException if {@code arrayType} is a null reference
1305 * @throws IllegalArgumentException if {@code arrayType} is not an array type
1306 * or {@code arrayType} is not assignable to this method handle's trailing parameter type
1312 public MethodHandle asVarargsCollector(Class<?> arrayType) {
1313 Objects.requireNonNull(arrayType);
1314 boolean lastMatch = asCollectorChecks(arrayType, type().parameterCount() - 1, 0);
1317 return MethodHandleImpl.makeVarargsCollector(this, arrayType);