- java.lang.Object
-
- com.headius.invokebinder.transform.Transform
-
- com.headius.invokebinder.transform.Collect
-
public class Collect extends Transform
An argument-boxing transform with a fixed incoming size. Equivalent call: MethodHandle.asCollector(Class, int) or MethodHandles.collectArguments
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCollect.Permutes
-
Constructor Summary
Constructors Constructor Description Collect(java.lang.invoke.MethodType source, int index, int count, java.lang.Class<?> arrayType)Collect(java.lang.invoke.MethodType source, int index, int count, java.lang.Class<?> arrayType, java.lang.invoke.MethodHandle collector)Collect(java.lang.invoke.MethodType source, int index, java.lang.Class<?> arrayType)Collect(java.lang.invoke.MethodType source, int index, java.lang.Class<?> arrayType, java.lang.invoke.MethodHandle collector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidassertTypesAreCompatible()private Collect.PermutesbuildPermutes(java.lang.invoke.MethodType source, java.lang.invoke.MethodType target)java.lang.invoke.MethodTypedown(java.lang.invoke.MethodType type)Apply this transform downward from an incoming MethodType, producing a new type.private booleanonlyTail()private BinderpreparePermuteBinder(Collect.Permutes permutes)java.lang.StringtoJava(java.lang.invoke.MethodType incoming)Return a Java code representation of this transform.java.lang.StringtoString()Return a string representation of this transform.java.lang.invoke.MethodHandleup(java.lang.invoke.MethodHandle target)Apply this transform upward from the given MethodHandle, producing a new handle.-
Methods inherited from class com.headius.invokebinder.transform.Transform
buildClassArgument, buildClassArguments, buildClassCast, buildPrimitiveJava, generateMethodType
-
-
-
-
Constructor Detail
-
Collect
public Collect(java.lang.invoke.MethodType source, int index, java.lang.Class<?> arrayType)
-
Collect
public Collect(java.lang.invoke.MethodType source, int index, java.lang.Class<?> arrayType, java.lang.invoke.MethodHandle collector)
-
Collect
public Collect(java.lang.invoke.MethodType source, int index, int count, java.lang.Class<?> arrayType)
-
Collect
public Collect(java.lang.invoke.MethodType source, int index, int count, java.lang.Class<?> arrayType, java.lang.invoke.MethodHandle collector)
-
-
Method Detail
-
up
public java.lang.invoke.MethodHandle up(java.lang.invoke.MethodHandle target)
Description copied from class:TransformApply this transform upward from the given MethodHandle, producing a new handle.
-
preparePermuteBinder
private Binder preparePermuteBinder(Collect.Permutes permutes)
-
down
public java.lang.invoke.MethodType down(java.lang.invoke.MethodType type)
Description copied from class:TransformApply this transform downward from an incoming MethodType, producing a new type.
-
assertTypesAreCompatible
private void assertTypesAreCompatible()
-
toString
public java.lang.String toString()
Description copied from class:TransformReturn a string representation of this transform.
-
toJava
public java.lang.String toJava(java.lang.invoke.MethodType incoming)
Description copied from class:TransformReturn a Java code representation of this transform.
-
onlyTail
private boolean onlyTail()
-
buildPermutes
private Collect.Permutes buildPermutes(java.lang.invoke.MethodType source, java.lang.invoke.MethodType target)
-
-