From 6fec1adc6432eeafcdea2ab165989e170cb6e64e Mon Sep 17 00:00:00 2001 From: doko Date: Wed, 19 Dec 2012 17:03:15 +0000 Subject: 2012-12-19 Matthias Klose Import GNU Classpath (20121202). * Regenerate class and header files. * Regenerate auto* files. * sources.am, gcj/javaprims.h: Regenerate. * gnu/java/nio/FileLockImpl.java (close): New override. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194618 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/java/lang/Integer.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libjava/classpath/java/lang/Integer.java') diff --git a/libjava/classpath/java/lang/Integer.java b/libjava/classpath/java/lang/Integer.java index f379795ea3d..25eb5d5265d 100644 --- a/libjava/classpath/java/lang/Integer.java +++ b/libjava/classpath/java/lang/Integer.java @@ -585,6 +585,23 @@ public final class Integer extends Number implements Comparable return value > i.value ? 1 : -1; } + /** + * Compares two unboxed int values. + * The result is positive if the first is greater, negative if the second + * is greater, and 0 if the two are equal. + * + * @param x First value to compare. + * @param y Second value to compare. + * + * @return positive int if the first value is greater, negative if the second + * is greater, and 0 if the two are equal. + * @since 1.7 + */ + public static int compare(int x, int y) + { + return Integer.valueOf(x).compareTo(Integer.valueOf(y)); + } + /** * Return the number of bits set in x. * @param x value to examine -- cgit v1.2.3