Package com.sun.jna
Klasse IntegerType
java.lang.Object
java.lang.Number
com.sun.jna.IntegerType
- Alle implementierten Schnittstellen:
NativeMapped
,Serializable
- Bekannte direkte Unterklassen:
BaseTSD.DWORD_PTR
,BaseTSD.LONG_PTR
,BaseTSD.ULONG_PTR
,LibCAPI.size_t
,LibCAPI.ssize_t
,NativeLong
,OaIdl.VARIANT_BOOL
,Structure.FFIType.size_t
,WinDef.BOOL
,WinDef.CHAR
,WinDef.DWORD
,WinDef.DWORDLONG
,WinDef.INT_PTR
,WinDef.LONG
,WinDef.LONGLONG
,WinDef.SHORT
,WinDef.UCHAR
,WinDef.UINT
,WinDef.UINT_PTR
,WinDef.ULONG
,WinDef.ULONGLONG
,WinDef.USHORT
,WinDef.WORD
,XAttr.size_t
,XAttr.ssize_t
Represents a native integer value, which may have a platform-specific size
(e.g.
long
on unix-based platforms).
May optionally indicate an unsigned attribute, such that when a value is
extracted into a larger-sized container (e.g. int
retrieved
via Number.longValue()
, the value will be unsigned. Default behavior
is signed.- Autor:
- [email protected], [email protected]
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungIntegerType
(int size) Create a zero-valued signed IntegerType.IntegerType
(int size, boolean unsigned) Create a zero-valued optionally unsigned IntegerType.IntegerType
(int size, long value) Create a signed IntegerType with the given value.IntegerType
(int size, long value, boolean unsigned) Create an optionally signed IntegerType with the given value. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic final int
compare
(long v1, long v2) static int
compare
(IntegerType v1, long v2) Compares a IntegerType value with along
one.static <T extends IntegerType>
intcompare
(T v1, T v2) Compares 2 derivedIntegerType
values - Note: anull
value is considered greater than any non-null
one (i.e.,null
values are "pushed" to the end of a sorted array / list of values)double
boolean
float
fromNative
(Object nativeValue, FromNativeContext context) Convert the given native object into its Java representation using the given context.int
hashCode()
int
intValue()
long
Class
<?> Indicate the native type used by this converter.void
setValue
(long value) Change the value for this data.toNative()
Convert this object into a supported native type.toString()
Von Klasse geerbte Methoden java.lang.Number
byteValue, shortValue
-
Konstruktordetails
-
IntegerType
public IntegerType(int size) Create a zero-valued signed IntegerType. -
IntegerType
public IntegerType(int size, boolean unsigned) Create a zero-valued optionally unsigned IntegerType. -
IntegerType
public IntegerType(int size, long value) Create a signed IntegerType with the given value. -
IntegerType
public IntegerType(int size, long value, boolean unsigned) Create an optionally signed IntegerType with the given value.
-
-
Methodendetails
-
setValue
public void setValue(long value) Change the value for this data.- Parameter:
value
- value to set
-
toNative
Beschreibung aus Schnittstelle kopiert:NativeMapped
Convert this object into a supported native type.- Angegeben von:
toNative
in SchnittstelleNativeMapped
- Gibt zurück:
- Java representation of the original Java object converted to a native type.
-
fromNative
Beschreibung aus Schnittstelle kopiert:NativeMapped
Convert the given native object into its Java representation using the given context.- Angegeben von:
fromNative
in SchnittstelleNativeMapped
- Parameter:
nativeValue
- Java representation of the native type to be converted.context
- Context in which the conversion is taking place.- Gibt zurück:
- Converted object.
-
nativeType
Beschreibung aus Schnittstelle kopiert:NativeMapped
Indicate the native type used by this converter.- Angegeben von:
nativeType
in SchnittstelleNativeMapped
- Gibt zurück:
- Java class representation of the native type.
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Angegeben von:
floatValue
in KlasseNumber
-
doubleValue
public double doubleValue()- Angegeben von:
doubleValue
in KlasseNumber
-
equals
-
toString
-
hashCode
public int hashCode() -
compare
Compares 2 derivedIntegerType
values - Note: anull
value is considered greater than any non-null
one (i.e.,null
values are "pushed" to the end of a sorted array / list of values)- Typparameter:
T
- the derived integer type- Parameter:
v1
- The 1st valuev2
- The 2nd value- Gibt zurück:
- 0 if values are equal - including if both are
null
, negative if 1st value less than 2nd one, positive otherwise. Note: the comparison uses thelongValue()
. - Siehe auch:
-
compare
Compares a IntegerType value with along
one. Note: if the IntegerType value isnull
then it is consider greater than anylong
value.- Parameter:
v1
- TheIntegerType
valuev2
- Thelong
value- Gibt zurück:
- 0 if values are equal, negative if 1st value less than 2nd one,
positive otherwise. Note: the comparison uses the
longValue()
. - Siehe auch:
-
compare
public static final int compare(long v1, long v2)
-