jnr.ffi
Enum NativeType

java.lang.Object
  extended by java.lang.Enum<NativeType>
      extended by jnr.ffi.NativeType
All Implemented Interfaces:
Serializable, Comparable<NativeType>

public enum NativeType
extends Enum<NativeType>

NativeType defines the primitive types supported internally. Usually you will not use these types directly, and should instead use the standard types such as Pointer, NativeLong, or any of the normal java types such as int, short. All other types are defined in terms of these primitive types.


Enum Constant Summary
ADDRESS
          Native memory address.
DOUBLE
          Double precision floating point.
FLOAT
          Single precision floating point.
SCHAR
          Signed char.
SINT
          Signed integer.
SLONG
          Signed long integer.
SLONGLONG
          Signed long long integer.
SSHORT
          Signed short integer.
STRUCT
          Native struct type
UCHAR
          Unsigned char.
UINT
          Unsigned integer.
ULONG
          Unsigned long integer.
ULONGLONG
          Unsigned long long integer.
USHORT
          Unsigned short integer.
VOID
          Void type.
 
Method Summary
static NativeType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static NativeType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VOID

public static final NativeType VOID
Void type. Only used for function return types.


SCHAR

public static final NativeType SCHAR
Signed char. Equivalent to a C char or signed char type. Usually 1 byte in size.


UCHAR

public static final NativeType UCHAR
Unsigned char. Equivalent to a C unsigned char type. Usually 1 byte in size


SSHORT

public static final NativeType SSHORT
Signed short integer. Equivalent to a C short or signed short type. Usually 2 bytes in size.


USHORT

public static final NativeType USHORT
Unsigned short integer. Equivalent to a C unsigned short type. Usually 2 bytes in size.


SINT

public static final NativeType SINT
Signed integer. Equivalent to a C int or signed int type. Usually 4 bytes in size.


UINT

public static final NativeType UINT
Unsigned integer. Equivalent to a C unsigned int type. Usually 4 bytes in size.


SLONG

public static final NativeType SLONG
Signed long integer. Equivalent to a C long or signed long type. Can be either 4 or 8 bytes in size, depending on the platform.


ULONG

public static final NativeType ULONG
Unsigned long integer. Equivalent to a C unsigned long type. Can be either 4 or 8 bytes in size, depending on the platform.


SLONGLONG

public static final NativeType SLONGLONG
Signed long long integer. Equivalent to a C long long or signed long long type. Usually 8 bytes in size.


ULONGLONG

public static final NativeType ULONGLONG
Unsigned long long integer. Equivalent to a C unsigned long long type. Usually 8 bytes in size.


FLOAT

public static final NativeType FLOAT
Single precision floating point. Equivalent to a C float type. Usually 4 bytes in size.


DOUBLE

public static final NativeType DOUBLE
Double precision floating point. Equivalent to a C double type. Usually 4 bytes in size.


STRUCT

public static final NativeType STRUCT
Native struct type


ADDRESS

public static final NativeType ADDRESS
Native memory address. Equivalent to a C void* or char* pointer type. Can be either 4 or 8 bytes in size, depending on the platform.

Method Detail

values

public static NativeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (NativeType c : NativeType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NativeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2012. All Rights Reserved.