Package org.jboss.util
Class Primitives
- java.lang.Object
-
- org.jboss.util.Primitives
-
public final class Primitives extends java.lang.Object
Primitive utilities.- Version:
- $Revision$
-
-
Constructor Summary
Constructors Constructor Description Primitives()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equals(byte[] a, byte[] b)
Test the equality of two byte arrays.static boolean
equals(byte[] a, int abegin, byte[] b, int bbegin, int length)
Test the equality of a given sub-section of two byte arrays.static boolean
equals(double a, double b)
Test the equality of two doubles by converting their values into IEEE 754 floating-point "double format" long values.static boolean
equals(float a, float b)
Test the equality of two doubles by converting their values into IEEE 754 floating-point "single precision" bit layouts.static java.lang.Boolean
valueOf(boolean value)
Get a Boolean from a boolean, equivalent to the java 1.4 method Boolean.valueOf(boolean)
-
-
-
Method Detail
-
valueOf
public static java.lang.Boolean valueOf(boolean value)
Get a Boolean from a boolean, equivalent to the java 1.4 method Boolean.valueOf(boolean)- Parameters:
value
- the boolean- Returns:
- the Boolean equivalent
-
equals
public static boolean equals(double a, double b)
Test the equality of two doubles by converting their values into IEEE 754 floating-point "double format" long values.- Parameters:
a
- Double to check equality with.b
- Double to check equality with.- Returns:
- True if a equals b.
-
equals
public static boolean equals(float a, float b)
Test the equality of two doubles by converting their values into IEEE 754 floating-point "single precision" bit layouts.- Parameters:
a
- Float to check equality with.b
- Float to check equality with.- Returns:
- True if a equals b.
-
equals
public static boolean equals(byte[] a, int abegin, byte[] b, int bbegin, int length)
Test the equality of a given sub-section of two byte arrays.- Parameters:
a
- The first byte array.abegin
- The begining index of the first byte array.b
- The second byte array.bbegin
- The begining index of the second byte array.length
- The length of the sub-section.- Returns:
- True if sub-sections are equal.
-
equals
public static boolean equals(byte[] a, byte[] b)
Test the equality of two byte arrays.- Parameters:
a
- The first byte array.b
- The second byte array.- Returns:
- True if the byte arrays are equal.
-
-