public class DefMath
extends java.lang.Object
Each operator must "support" the following types:
int,long,float,double,boolean,Object. Operators can throw exceptions if
the type is illegal. The Object type must be a "generic" handler that
handles all legal types: it must be convertible to every possible legal signature.
| Constructor and Description |
|---|
DefMath() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.invoke.MethodHandle |
cast(java.lang.Class<?> classA,
java.lang.invoke.MethodHandle target)
Forces a cast to class A for target (only if types differ)
|
static java.lang.invoke.MethodHandle |
dynamicCast(java.lang.invoke.MethodHandle target)
Looks up generic method, with a dynamic cast to the receiver's type.
|
static java.lang.invoke.MethodHandle |
dynamicCast(java.lang.invoke.MethodHandle target,
java.lang.Class<?> desired)
Looks up generic method, with a dynamic cast to the specified type.
|
static java.lang.invoke.MethodHandle |
lookupBinary(java.lang.Class<?> classA,
java.lang.Class<?> classB,
java.lang.String name)
Returns an appropriate method handle for a binary operator, based on promotion of the LHS and RHS arguments
|
static java.lang.invoke.MethodHandle |
lookupGeneric(java.lang.String name)
Returns a generic method handle for any operator, that can handle all valid signatures, nulls, corner cases
|
static java.lang.invoke.MethodHandle |
lookupUnary(java.lang.Class<?> receiverClass,
java.lang.String name)
Returns an appropriate method handle for a unary or shift operator, based only on the receiver (LHS)
|
static java.lang.Object |
lsh(java.lang.Object left,
long right) |
static java.lang.Object |
rsh(java.lang.Object left,
long right) |
static java.lang.Object |
ush(java.lang.Object left,
long right) |
public static java.lang.Object lsh(java.lang.Object left,
long right)
public static java.lang.Object rsh(java.lang.Object left,
long right)
public static java.lang.Object ush(java.lang.Object left,
long right)
public static java.lang.invoke.MethodHandle lookupUnary(java.lang.Class<?> receiverClass,
java.lang.String name)
public static java.lang.invoke.MethodHandle lookupBinary(java.lang.Class<?> classA,
java.lang.Class<?> classB,
java.lang.String name)
public static java.lang.invoke.MethodHandle lookupGeneric(java.lang.String name)
public static java.lang.invoke.MethodHandle dynamicCast(java.lang.invoke.MethodHandle target)
public static java.lang.invoke.MethodHandle dynamicCast(java.lang.invoke.MethodHandle target,
java.lang.Class<?> desired)
public static java.lang.invoke.MethodHandle cast(java.lang.Class<?> classA,
java.lang.invoke.MethodHandle target)