Lines Matching defs:arrayLength

735      * {@code arrayLength} parameters of the target's type are replaced
795 * @param arrayLength the number of arguments to spread from an incoming array argument
801 * {@code arrayLength} parameter types,
802 * or if {@code arrayLength} is negative
806 public MethodHandle asSpreader(Class<?> arrayType, int arrayLength) {
807 asSpreaderChecks(arrayType, arrayLength);
808 int spreadArgPos = type.parameterCount() - arrayLength;
809 return MethodHandleImpl.makeSpreadArguments(this, arrayType, spreadArgPos, arrayLength);
812 private void asSpreaderChecks(Class<?> arrayType, int arrayLength) {
813 spreadArrayChecks(arrayType, arrayLength);
815 if (nargs < arrayLength || arrayLength < 0)
817 if (arrayType != Object[].class && arrayLength != 0) {
820 for (int i = nargs - arrayLength; i < nargs; i++) {
828 for (int i = nargs - arrayLength; i < nargs; i++) {
837 private void spreadArrayChecks(Class<?> arrayType, int arrayLength) {
841 if ((arrayLength & 0x7F) != arrayLength) {
842 if ((arrayLength & 0xFF) != arrayLength)
843 throw newIllegalArgumentException("array length is not legal", arrayLength);
844 assert(arrayLength >= 128);
847 throw newIllegalArgumentException("array length is not legal for long[] or double[]", arrayLength);
858 * {@code arrayLength} parameters whose type is element type of {@code arrayType}.
864 * When called, the adapter replaces its trailing {@code arrayLength}
870 * (The array may also be a shared constant when {@code arrayLength} is zero.)
909 * @param arrayLength the number of arguments to collect into a new array argument
915 * or {@code arrayLength} is not a legal array size
920 public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
921 asCollectorChecks(arrayType, arrayLength);
926 MethodHandle collector = ValueConversions.varargsArray(arrayType, arrayLength);
931 private boolean asCollectorChecks(Class<?> arrayType, int arrayLength) {
932 spreadArrayChecks(arrayType, arrayLength);