Package com.strobel.expressions
Class LambdaExpression<T>
- java.lang.Object
-
- com.strobel.expressions.Expression
-
- com.strobel.expressions.LambdaExpression<T>
-
public final class LambdaExpression<T> extends Expression
-
-
Field Summary
Fields Modifier and Type Field Description private Expression_bodyprivate java.lang.Class<?>_creationContextprivate Type<T>_interfaceTypeprivate java.lang.String_nameprivate ParameterExpressionList_parametersprivate Type_returnTypeprivate boolean_tailCall
-
Constructor Summary
Constructors Constructor Description LambdaExpression(Type<T> interfaceType, java.lang.String name, Expression body, boolean tailCall, ParameterExpressionList parameters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Expressionaccept(ExpressionVisitor visitor)Dispatches to the specific visit method for this node type.(package private) LambdaExpression<T>accept(StackSpiller spiller)Tcompile()Delegate<T>compileDelegate()java.lang.invoke.MethodHandlecompileHandle()voidcompileToMethod(MethodBuilder methodBuilder)MethodInfocompileToMethod(TypeBuilder<?> typeBuilder)MethodInfocompileToMethod(TypeBuilder<?> typeBuilder, java.lang.String name)MethodInfocompileToMethod(TypeBuilder<?> typeBuilder, java.lang.String name, int modifiers)ExpressiongetBody()(package private) java.lang.Class<?>getCreationContext()java.lang.StringgetName()ExpressionTypegetNodeType()Returns the node type of thisExpression.ParameterExpressionListgetParameters()TypegetReturnType()Type<T>getType()Gets the static type of the expression that thisExpressionrepresents.booleanisTailCall()private static <T> Type<T>resolveDelegateType(Expression body, ParameterExpressionList parameters)LambdaExpression<T>update(Expression body, ParameterExpressionList parameters)-
Methods inherited from class com.strobel.expressions.Expression
add, add, addAssign, addAssign, addAssign, and, and, andAlso, andAlso, andAlso, andAssign, andAssign, andAssign, arrayIndex, arrayLength, arrayToList, arrayToList, arrayToReadOnlyList, assign, base, block, block, block, block, block, block, block, block, block, block, block, block, block, block, box, call, call, call, call, call, call, call, call, call, call, canReduce, classConstant, coalesce, coalesce, concat, concat, concat, condition, condition, constant, constant, convert, convert, decrement, decrement, defaultValue, divide, divide, divideAssign, divideAssign, divideAssign, empty, ensureUnmodifiable, equal, equal, exclusiveOr, exclusiveOr, exclusiveOrAssign, exclusiveOrAssign, exclusiveOrAssign, field, field, field, field, forEach, forEach, forEach, getDebugView, getInvokeMethod, getInvokeMethod, getMethodValidated, greaterThan, greaterThan, greaterThanOrEqual, greaterThanOrEqual, ifThen, ifThenElse, increment, increment, instanceOf, invoke, invoke, isFalse, isFalse, isNotNull, isNull, isTrue, isTrue, label, label, label, label, label, label, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda, leftShift, leftShift, leftShiftAssign, leftShiftAssign, leftShiftAssign, lessThan, lessThan, lessThanOrEqual, lessThanOrEqual, loop, loop, loop, makeBinary, makeBinary, makeBinary, makeBinary, makeBinary, makeBreak, makeBreak, makeBreak, makeBreak, makeCatch, makeCatch, makeCatch, makeCatch, makeCatch, makeCatch, makeContinue, makeContinue, makeFor, makeFor, makeFor, makeGoto, makeGoto, makeGoto, makeGoto, makeGoto, makeMemberAccess, makeNew, makeNew, makeNew, makeNew, makeReturn, makeReturn, makeReturn, makeReturn, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeSwitch, makeThrow, makeThrow, makeTry, makeTry, makeTry, makeUnary, makeUnary, methodArgumentsMatch, modulo, modulo, moduloAssign, moduloAssign, moduloAssign, multiply, multiply, multiplyAssign, multiplyAssign, multiplyAssign, negate, negate, newArrayBounds, newArrayInit, newArrayInit, not, not, notEqual, notEqual, onesComplement, onesComplement, or, or, orAssign, orAssign, orAssign, orElse, orElse, orElse, parameter, parameter, parameterIsAssignable, parameters, performBinaryNumericPromotion, postDecrementAssign, postDecrementAssign, postIncrementAssign, postIncrementAssign, preDecrementAssign, preDecrementAssign, preIncrementAssign, preIncrementAssign, reduce, reduceAndCheck, reduceExtensions, referenceEqual, referenceNotEqual, returnObject, rightShift, rightShift, rightShiftAssign, rightShiftAssign, rightShiftAssign, runtimeVariables, runtimeVariables, self, subtract, subtract, subtractAssign, subtractAssign, subtractAssign, switchCase, switchCase, toString, tryCatch, tryCatchFinally, tryFinally, typeEqual, unaryPlus, unaryPlus, unbox, unbox, unsignedRightShift, unsignedRightShift, unsignedRightShiftAssign, unsignedRightShiftAssign, unsignedRightShiftAssign, validateVariables, variable, variable, variables, visitChildren
-
-
-
-
Field Detail
-
_name
private final java.lang.String _name
-
_body
private final Expression _body
-
_parameters
private final ParameterExpressionList _parameters
-
_tailCall
private final boolean _tailCall
-
_returnType
private final Type _returnType
-
_creationContext
private java.lang.Class<?> _creationContext
-
-
Constructor Detail
-
LambdaExpression
LambdaExpression(Type<T> interfaceType, java.lang.String name, Expression body, boolean tailCall, ParameterExpressionList parameters)
-
-
Method Detail
-
resolveDelegateType
private static <T> Type<T> resolveDelegateType(Expression body, ParameterExpressionList parameters)
-
getType
public final Type<T> getType()
Description copied from class:ExpressionGets the static type of the expression that thisExpressionrepresents.- Overrides:
getTypein classExpression- Returns:
- the
Typethat represents the static type of the expression.
-
getNodeType
public ExpressionType getNodeType()
Description copied from class:ExpressionReturns the node type of thisExpression.- Overrides:
getNodeTypein classExpression- Returns:
- the
ExpressionTypethat represents this expression.
-
getName
public final java.lang.String getName()
-
getBody
public final Expression getBody()
-
getParameters
public final ParameterExpressionList getParameters()
-
getReturnType
public final Type getReturnType()
-
isTailCall
public final boolean isTailCall()
-
update
public final LambdaExpression<T> update(Expression body, ParameterExpressionList parameters)
-
accept
protected Expression accept(ExpressionVisitor visitor)
Description copied from class:ExpressionDispatches to the specific visit method for this node type. For example,BinaryExpressionwill call intoExpressionVisitor.visitBinary().- Overrides:
acceptin classExpression- Parameters:
visitor- the visitor to visit this node.- Returns:
- the result of visiting this node.
-
accept
final LambdaExpression<T> accept(StackSpiller spiller)
-
getCreationContext
final java.lang.Class<?> getCreationContext()
-
compile
public final T compile()
-
compileHandle
public final java.lang.invoke.MethodHandle compileHandle()
-
compileToMethod
public final void compileToMethod(MethodBuilder methodBuilder)
-
compileToMethod
public final MethodInfo compileToMethod(TypeBuilder<?> typeBuilder)
-
compileToMethod
public final MethodInfo compileToMethod(TypeBuilder<?> typeBuilder, java.lang.String name)
-
compileToMethod
public final MethodInfo compileToMethod(TypeBuilder<?> typeBuilder, java.lang.String name, int modifiers)
-
-