1 /* 2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 final __ByValue class Value { 27 static final Value VT = makeValue('\u0123', true, (byte)0x01, 0x01234567, (short)0x0123, 0x0123456789ABCDEFL, 1.0f, 1.0d); 28 final char char_v; 29 final byte byte_v; 30 final boolean boolean_v; 31 final int int_v; 32 final short short_v; 33 final long long_v; 34 final double double_v; 35 final float float_v; 36 Value() { 37 char_v = 'z'; 38 boolean_v = true; 39 byte_v = 0; 40 int_v = 1; 41 short_v = 2; 42 long_v = 3; 43 float_v = 0.1f; 44 double_v = 0.2d; 45 } 46 static Value makeValue(char c, boolean z, byte b, int x, short y, long l, float f, double d) { 47 Value v = __MakeDefault Value(); 48 v.char_v = c; 49 v.byte_v = b; 50 v.boolean_v = z; 51 v.int_v = x; 52 v.short_v = y; 53 v.long_v = l; 54 v.float_v = f; 55 v.double_v = d; 56 return v; 57 } 58 }