Compare.java revision 2362
1701N/A * Copyright 2009 Google, Inc. All Rights Reserved. 1701N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1701N/A * This code is free software; you can redistribute it and/or modify it 1701N/A * under the terms of the GNU General Public License version 2 only, as 1701N/A * published by the Free Software Foundation. 1701N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1701N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1701N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1701N/A * version 2 for more details (a copy is included in the LICENSE file that 1701N/A * You should have received a copy of the GNU General Public License version 1701N/A * 2 along with this work; if not, write to the Free Software Foundation, 1701N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1701N/A * @summary Test the primitive wrappers compare and compareTo methods 1701N/A x < y ? -
1 : x > y ?
1 :
0);
1701N/A int a = (
int) x, b = (
int) y;
1701N/A a < b ? -
1 : a > b ?
1 :
0);
1701N/A short a = (
short) x, b = (
short) y;
1701N/A char a = (
char) x, b = (
char) y;
1701N/A byte a = (
byte) x, b = (
byte) y;
1701N/A //--------------------- Infrastructure ---------------------------