com.kenai.jaffl

Class NativeLong

public final class NativeLong extends Number implements Comparable<NativeLong>

Represents a C long.

In C, a long can be either 32 bits or 64bits, depending on the platform.

Replace any function parameters which are long in the C definition with a NativeLong.

Field Summary
static longMASK
static intSHIFT
static intSIZE
Constructor Summary
NativeLong(long value)
Creates a new NativeLong instance with the supplied value.
Method Summary
intcompareTo(NativeLong other)
Compares two {@code NativeLong} instances numerically.
static NativeLongvalueOf(long value)
Returns a NativeLong instance representing the specified long value
static NativeLongvalueOf(int value)
Returns a NativeLong instance representing the specified int value

Field Detail

MASK

public static final long MASK

SHIFT

public static final int SHIFT

SIZE

public static final int SIZE

Constructor Detail

NativeLong

public NativeLong(long value)
Creates a new NativeLong instance with the supplied value.

Parameters: value a long or integer.

Method Detail

compareTo

public final int compareTo(NativeLong other)
Compares two {@code NativeLong} instances numerically.

Parameters: other the other NativeLong to compare to.

Returns: {@code 0} if {@code other} is equal to this instance, -1 if this instance is numerically less than {@code other} or 1 if this instance is numerically greater than {@code other}.

valueOf

public static final NativeLong valueOf(long value)
Returns a NativeLong instance representing the specified long value

Parameters: value a long value

Returns: a NativeLong instance representing value

valueOf

public static final NativeLong valueOf(int value)
Returns a NativeLong instance representing the specified int value

Parameters: value a 32bit integer value

Returns: a NativeLong instance representing value