summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/lang/Long.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/Long.java')
-rw-r--r--libjava/classpath/java/lang/Long.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/libjava/classpath/java/lang/Long.java b/libjava/classpath/java/lang/Long.java
index e7579d86556..6f31dfa9953 100644
--- a/libjava/classpath/java/lang/Long.java
+++ b/libjava/classpath/java/lang/Long.java
@@ -585,6 +585,23 @@ public final class Long extends Number implements Comparable<Long>
}
/**
+ * Compares two unboxed long 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(long x, long y)
+ {
+ return Long.valueOf(x).compareTo(Long.valueOf(y));
+ }
+
+ /**
* Return the number of bits set in x.
* @param x value to examine
* @since 1.5
OpenPOWER on IntegriCloud