Lines Matching refs:Wrapper

58     private static EnumMap<Wrapper, MethodHandle>[] newWrapperCaches(int n) {
60 EnumMap<Wrapper, MethodHandle>[] caches
61 = (EnumMap<Wrapper, MethodHandle>[]) new EnumMap<?,?>[n];
63 caches[i] = new EnumMap<>(Wrapper.class);
77 return primitiveConversion(Wrapper.INT, x, cast).intValue();
83 return primitiveConversion(Wrapper.BYTE, x, cast).byteValue();
89 return primitiveConversion(Wrapper.SHORT, x, cast).shortValue();
95 return (primitiveConversion(Wrapper.BOOLEAN, x, cast).intValue() & 1) != 0;
101 return (char) primitiveConversion(Wrapper.CHAR, x, cast).intValue();
107 return primitiveConversion(Wrapper.LONG, x, cast).longValue();
113 return primitiveConversion(Wrapper.FLOAT, x, cast).floatValue();
119 return primitiveConversion(Wrapper.DOUBLE, x, cast).doubleValue();
122 private static MethodType unboxType(Wrapper wrap) {
126 private static final EnumMap<Wrapper, MethodHandle>[]
129 private static MethodHandle unbox(Wrapper wrap, boolean cast) {
130 EnumMap<Wrapper, MethodHandle> cache = UNBOX_CONVERSIONS[(cast?1:0)];
163 public static MethodHandle unboxCast(Wrapper type) {
168 return unbox(Wrapper.forPrimitiveType(type), false);
172 return unbox(Wrapper.forPrimitiveType(type), true);
184 public static Number primitiveConversion(Wrapper wrap, Object x, boolean cast) {
185 // Maybe merge this code with Wrapper.convert/cast.
201 Wrapper xwrap = Wrapper.findWrapperType(x.getClass());
263 private static MethodType boxType(Wrapper wrap) {
269 private static final EnumMap<Wrapper, MethodHandle>[]
272 private static MethodHandle box(Wrapper wrap, boolean exact) {
273 EnumMap<Wrapper, MethodHandle> cache = BOX_CONVERSIONS[(exact?1:0)];
314 return box(Wrapper.forPrimitiveType(type), exact);
317 public static MethodHandle box(Wrapper type) {
351 private static final EnumMap<Wrapper, MethodHandle>[]
354 public static MethodHandle zeroConstantFunction(Wrapper wrap) {
355 EnumMap<Wrapper, MethodHandle> cache = CONSTANT_FUNCTIONS[0];
381 if (wrap.isSubwordOrInt() && wrap != Wrapper.INT) {
382 mh = MethodHandles.explicitCastArguments(zeroConstantFunction(Wrapper.INT), type);
497 COPY_AS_PRIMITIVE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "copyAsPrimitiveArray", MethodType.methodType(Object.class, Wrapper.class, Object[].class));
550 private static final EnumMap<Wrapper, MethodHandle>[] WRAPPER_CASTS
559 Wrapper wrap = null;
560 EnumMap<Wrapper, MethodHandle> cache = null;
561 if (Wrapper.isWrapperType(type)) {
562 wrap = Wrapper.forWrapperType(type);
581 return identity(Wrapper.findPrimitiveType(type));
584 public static MethodHandle identity(Wrapper wrap) {
585 EnumMap<Wrapper, MethodHandle> cache = CONSTANT_FUNCTIONS[1];
592 if (wrap != Wrapper.VOID)
599 if (mh == null && wrap == Wrapper.VOID) {
820 private static final EnumMap<Wrapper, MethodHandle>[]
821 CONVERT_PRIMITIVE_FUNCTIONS = newWrapperCaches(Wrapper.values().length);
823 public static MethodHandle convertPrimitive(Wrapper wsrc, Wrapper wdst) {
824 EnumMap<Wrapper, MethodHandle> cache = CONVERT_PRIMITIVE_FUNCTIONS[wsrc.ordinal()];
835 } else if (wsrc == Wrapper.VOID) {
837 } else if (wdst == Wrapper.VOID) {
839 } else if (wsrc == Wrapper.OBJECT) {
841 } else if (wdst == Wrapper.OBJECT) {
862 return convertPrimitive(Wrapper.forPrimitiveType(src), Wrapper.forPrimitiveType(dst));
875 Wrapper sw = (src.isPrimitive() ? Wrapper.forPrimitiveType(src) : null);
876 Wrapper dw = (dst.isPrimitive() ? Wrapper.forPrimitiveType(dst) : null);
1015 private static Object copyAsPrimitiveArray(Wrapper w, Object... boxes) {
1162 return LazyStatics.COPY_AS_PRIMITIVE_ARRAY.bindTo(Wrapper.forPrimitiveType(elemType));