public abstract class Type
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Type.Builtin
Types that are built-in to libffi.
|
(package private) static class |
Type.TypeInfo
This 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.
|
Modifier and Type | Field and Description |
---|---|
private int |
alignment |
static Type |
DOUBLE
The native double type
|
static Type |
FLOAT
The native float type
|
private long |
handle |
static Type |
LONGDOUBLE
The native long double type
|
static Type |
POINTER
The native memory address type
|
static Type |
SCHAR
The native signed char type
|
static Type |
SINT
The native signed integer type
|
static Type |
SINT16
The native signed 16 bit integer type
|
static Type |
SINT32
The native signed 32 bit integer type
|
static Type |
SINT64
The native signed 64 bit integer type
|
static Type |
SINT8
The native signed 8 bit integer type
|
private int |
size |
static Type |
SLONG
The native signed long integer type
|
static Type |
SLONG_LONG
The native signed long long integer type
|
static Type |
SSHORT
The native signed short integer type
|
private int |
type |
static Type |
UCHAR
The native unsigned char type
|
static Type |
UINT
The native unsigned integer type
|
static Type |
UINT16
The native unsigned 16 bit integer type
|
static Type |
UINT32
The native unsigned 32 bit integer type
|
static Type |
UINT64
The native unsigned 64 bit integer type
|
static Type |
UINT8
The native unsigned 8 bit integer type
|
static Type |
ULONG
The native unsigned long integer type
|
static Type |
ULONG_LONG
The native unsigned long long integer type
|
static Type |
USHORT
The native unsigned short integer type
|
static Type |
VOID
The native void type
|
Constructor and Description |
---|
Type() |
Modifier and Type | Method and Description |
---|---|
int |
alignment()
Gets the alignment of this type.
|
private static Type |
builtin(NativeType nativeType)
Creates a Type instance for builtin types.
|
boolean |
equals(java.lang.Object obj) |
(package private) abstract Type.TypeInfo |
getTypeInfo() |
(package private) long |
handle()
Gets the native address of the ffi_type struct for this Type
|
int |
hashCode() |
(package private) static long[] |
nativeHandles(java.util.List<Type> types)
Converts a list of Type objects into an array of pointers to
ffi_type structures.
|
(package private) static long[] |
nativeHandles(Type[] types)
Converts an array of Type objects into an array of pointers to
ffi_type structures.
|
private int |
resolveAlignment() |
private long |
resolveHandle() |
private int |
resolveSize() |
private int |
resolveType() |
int |
size()
Gets the size of this type.
|
int |
type()
Gets the FFI type enum value for this Type
|
public static final Type VOID
public static final Type FLOAT
public static final Type DOUBLE
public static final Type LONGDOUBLE
public static final Type UINT8
public static final Type SINT8
public static final Type UINT16
public static final Type SINT16
public static final Type UINT32
public static final Type SINT32
public static final Type UINT64
public static final Type SINT64
public static final Type POINTER
public static final Type UCHAR
public static final Type SCHAR
public static final Type USHORT
public static final Type SSHORT
public static final Type UINT
public static final Type SINT
public static final Type ULONG
public static final Type SLONG
public static final Type ULONG_LONG
public static final Type SLONG_LONG
private int type
private int size
private int alignment
private volatile long handle
public final int type()
final long handle()
public final int size()
public final int alignment()
private int resolveType()
private int resolveSize()
private int resolveAlignment()
private long resolveHandle()
abstract Type.TypeInfo getTypeInfo()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
static long[] nativeHandles(Type[] types)
types
- An array of Type objectsstatic long[] nativeHandles(java.util.List<Type> types)
types
- A list of Type objectsprivate static Type builtin(NativeType nativeType)
nativeType
- The builtin type enum.