summaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang/Boolean.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/Boolean.java')
-rw-r--r--libjava/classpath/java/lang/Boolean.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/libjava/classpath/java/lang/Boolean.java b/libjava/classpath/java/lang/Boolean.java
index f2eaf412592..0e4afa813bf 100644
--- a/libjava/classpath/java/lang/Boolean.java
+++ b/libjava/classpath/java/lang/Boolean.java
@@ -237,6 +237,21 @@ public final class Boolean implements Serializable, Comparable<Boolean>
}
/**
+ * Compares two unboxed boolean values.
+ *
+ * @param x First value to compare.
+ * @param y Second value to compare.
+ * @return 0 if both Booleans represent the same value, a positive number
+ * if this Boolean represents true and the other false, and a negative
+ * number otherwise.
+ * @since 1.7
+ */
+ public static int compare(boolean x, boolean y)
+ {
+ return Boolean.valueOf(x).compareTo(Boolean.valueOf(y));
+ }
+
+ /**
* If the String argument is "true", ignoring case, return true.
* Otherwise, return false.
*