Top Description Inners Fields Constructors Methods
jnr.ffi

public final Class NativeLong

extends Number
implements Comparable<NativeLong>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
NativeLong.Cache

Internal cache of common native long values

Field Summary

Modifier and TypeField and Description
private static final NativeLong
private static final NativeLong
private final long
private static final NativeLong

Constructor Summary

AccessConstructor and Description
public
NativeLong(long
a long or integer.
value
)

Creates a new NativeLong instance with the supplied value.

public
NativeLong(int
an integer.
value
)

Creates a new NativeLong instance with the supplied value.

Method Summary

Modifier and TypeMethod and Description
private static NativeLong
_valueOf(final long value)

private static NativeLong
_valueOf(final int value)

public final int

Returns:

0 if other is equal to this instance, -1 if this instance is numerically less than other or 1 if this instance is numerically greater than other.
compareTo
(NativeLong
the other NativeLong to compare to.
other
)

Implements java.lang.Comparable.compareTo.

Compares two NativeLong instances numerically.
public final double

Returns:

an double value for this NativeLong.
doubleValue
()

Implements abstract java.lang.Number.doubleValue.

Returns an double representation of this NativeLong.
public final boolean

Returns:

true if this NativeLong is equal to the other NativeLong, else false.
equals
(Object
the other NativeLong to compare to.
obj
)

Overrides java.lang.Object.equals.

Compares this NativeLong to another NativeLong.
public final float

Returns:

an float value for this NativeLong.
floatValue
()

Implements abstract java.lang.Number.floatValue.

Returns an float representation of this NativeLong.
public final int

Returns:

a hash code for this NativeLong.
hashCode
()

Overrides java.lang.Object.hashCode.

Gets a hash code for this NativeLong.
public final int

Returns:

an integer value for this NativeLong.
intValue
()

Implements abstract java.lang.Number.intValue.

Returns an integer representation of this NativeLong.
public final long

Returns:

an long value for this NativeLong.
longValue
()

Implements abstract java.lang.Number.longValue.

Returns an long representation of this NativeLong.
public String

Returns:

a string representation of this NativeLong.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this NativeLong.
public static NativeLong

Returns:

a NativeLong instance representing value
valueOf
(final long
a long value
value
)

Returns a NativeLong instance representing the specified long value

public static NativeLong

Returns:

a NativeLong instance representing value
valueOf
(final int
a 32bit integer value
value
)

Returns a NativeLong instance representing the specified int value

Inherited from java.lang.Number:
byteValueshortValue

Field Detail

MINUS_ONEback to summary
private static final NativeLong MINUS_ONE
ONEback to summary
private static final NativeLong ONE
valueback to summary
private final long value
ZEROback to summary
private static final NativeLong ZERO

Constructor Detail

NativeLongback to summary
public NativeLong(long value)

Creates a new NativeLong instance with the supplied value.

Parameters
value:long

a long or integer.

NativeLongback to summary
public NativeLong(int value)

Creates a new NativeLong instance with the supplied value.

Parameters
value:int

an integer.

Method Detail

_valueOfback to summary
private static NativeLong _valueOf(final long value)
_valueOfback to summary
private static NativeLong _valueOf(final int value)
compareToback to summary
public final int compareTo(NativeLong other)

Implements java.lang.Comparable.compareTo.

Compares two NativeLong instances numerically.

Parameters
other:NativeLong

the other NativeLong to compare to.

Returns:int

0 if other is equal to this instance, -1 if this instance is numerically less than other or 1 if this instance is numerically greater than other.

doubleValueback to summary
public final double doubleValue()

Implements abstract java.lang.Number.doubleValue.

Returns an double representation of this NativeLong.

Returns:double

an double value for this NativeLong.

Annotations
@Override
equalsback to summary
public final boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares this NativeLong to another NativeLong.

Parameters
obj:Object

the other NativeLong to compare to.

Returns:boolean

true if this NativeLong is equal to the other NativeLong, else false.

Annotations
@Override
floatValueback to summary
public final float floatValue()

Implements abstract java.lang.Number.floatValue.

Returns an float representation of this NativeLong.

Returns:float

an float value for this NativeLong.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Gets a hash code for this NativeLong.

Returns:int

a hash code for this NativeLong.

Annotations
@Override
intValueback to summary
public final int intValue()

Implements abstract java.lang.Number.intValue.

Returns an integer representation of this NativeLong.

Returns:int

an integer value for this NativeLong.

Annotations
@Override
longValueback to summary
public final long longValue()

Implements abstract java.lang.Number.longValue.

Returns an long representation of this NativeLong.

Returns:long

an long value for this NativeLong.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this NativeLong.

Returns:String

a string representation of this NativeLong.

Annotations
@Override
valueOfback to summary
public static NativeLong valueOf(final long value)

Returns a NativeLong instance representing the specified long value

Parameters
value:long

a long value

Returns:NativeLong

a NativeLong instance representing value

valueOfback to summary
public static NativeLong valueOf(final int value)

Returns a NativeLong instance representing the specified int value

Parameters
value:int

a 32bit integer value

Returns:NativeLong

a NativeLong instance representing value

jnr.ffi back to summary

private final Class NativeLong.Cache

extends Object
Class Inheritance

Internal cache of common native long values

Field Summary

Modifier and TypeField and Description
pack-priv static final NativeLong[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
pack-priv static final NativeLong[] cache

Constructor Detail

Cacheback to summary
private Cache()