Class Type
java.lang.Object
com.kenai.jffi.Type
- Direct Known Subclasses:
Aggregate, Type.Builtin
Native parameter and return types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classTypes that are built-in to libffi.(package private) static final classThis is a lazy loaded cache of builtin type info, so we can still have Type.VOID as a public static variable without it causing the native library to load. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intstatic final TypeThe native double typestatic final TypeThe native float typeprivate longstatic final TypeThe native long double typestatic final TypeThe native memory address typestatic final TypeThe native signed char typestatic final TypeThe native signed integer typestatic final TypeThe native signed 16 bit integer typestatic final TypeThe native signed 32 bit integer typestatic final TypeThe native signed 64 bit integer typestatic final TypeThe native signed 8 bit integer typeprivate intstatic final TypeThe native signed long integer typestatic final TypeThe native signed long long integer typestatic final TypeThe native signed short integer typeprivate intstatic final TypeThe native unsigned char typestatic final TypeThe native unsigned integer typestatic final TypeThe native unsigned 16 bit integer typestatic final TypeThe native unsigned 32 bit integer typestatic final TypeThe native unsigned 64 bit integer typestatic final TypeThe native unsigned 8 bit integer typestatic final TypeThe native unsigned long integer typestatic final TypeThe native unsigned long long integer typestatic final TypeThe native unsigned short integer typestatic final TypeThe native void type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intGets the alignment of this type.private static Typebuiltin(NativeType nativeType) Creates aTypeinstance for builtin types.boolean(package private) abstract Type.TypeInfo(package private) final longhandle()Gets the native address of the ffi_type struct for thisTypeinthashCode()(package private) static long[]nativeHandles(Type[] types) Converts an array ofTypeobjects into an array of pointers to ffi_type structures.(package private) static long[]nativeHandles(List<Type> types) Converts a list ofTypeobjects into an array of pointers to ffi_type structures.private intprivate longprivate intprivate intfinal intsize()Gets the size of this type.final inttype()Gets the FFI type enum value for thisType
-
Field Details
-
VOID
The native void type -
FLOAT
The native float type -
DOUBLE
The native double type -
LONGDOUBLE
The native long double type -
UINT8
The native unsigned 8 bit integer type -
SINT8
The native signed 8 bit integer type -
UINT16
The native unsigned 16 bit integer type -
SINT16
The native signed 16 bit integer type -
UINT32
The native unsigned 32 bit integer type -
SINT32
The native signed 32 bit integer type -
UINT64
The native unsigned 64 bit integer type -
SINT64
The native signed 64 bit integer type -
POINTER
The native memory address type -
UCHAR
The native unsigned char type -
SCHAR
The native signed char type -
USHORT
The native unsigned short integer type -
SSHORT
The native signed short integer type -
UINT
The native unsigned integer type -
SINT
The native signed integer type -
ULONG
The native unsigned long integer type -
SLONG
The native signed long integer type -
ULONG_LONG
The native unsigned long long integer type -
SLONG_LONG
The native signed long long integer type -
type
private int type -
size
private int size -
alignment
private int alignment -
handle
private volatile long handle
-
-
Constructor Details
-
Type
public Type()
-
-
Method Details
-
type
public final int type()Gets the FFI type enum value for thisType- Returns:
- An integer representing the FFI type.
-
handle
final long handle()Gets the native address of the ffi_type struct for thisType- Returns:
- The address of the ffi_type structure
-
size
public final int size()Gets the size of this type.- Returns:
- The size of this type, in bytes.
-
alignment
public final int alignment()Gets the alignment of this type.- Returns:
- The alignment of this type, in bytes.
-
resolveType
private int resolveType() -
resolveSize
private int resolveSize() -
resolveAlignment
private int resolveAlignment() -
resolveHandle
private long resolveHandle() -
getTypeInfo
-
equals
-
hashCode
-
nativeHandles
Converts an array ofTypeobjects into an array of pointers to ffi_type structures.- Parameters:
types- An array ofTypeobjects- Returns:
- An array of native ffi_type handles.
-
nativeHandles
-
builtin
Creates aTypeinstance for builtin types.- Parameters:
nativeType- The builtin type enum.- Returns:
- A
Typeinstance.
-