Package jnr.ffi
Class Type
- java.lang.Object
-
- jnr.ffi.Type
-
- Direct Known Subclasses:
BadType
,StructLayout
public abstract class Type extends java.lang.Object
Type is the superclass for all internal types used by jnr-ffi.Use this type to access meta-data about a native type, such as its size or natural alignment.
To obtain an instance of this class, use
Runtime.findType(NativeType)
orRuntime.findType(TypeAlias)
.Example
Type pointerType = runtime.findType(NativeType.ADDRESS); System.out.println("The size of a pointer on this platform is " + pointerType.size());
-
-
Constructor Summary
Constructors Constructor Description Type()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract int
alignment()
The native alignment of this type, in bytesabstract NativeType
getNativeType()
The native type of this typeabstract int
size()
The size in bytes of this type.
-
-
-
Method Detail
-
size
public abstract int size()
The size in bytes of this type.- Returns:
- An integer
-
alignment
public abstract int alignment()
The native alignment of this type, in bytes- Returns:
- An integer
-
getNativeType
public abstract NativeType getNativeType()
The native type of this type- Returns:
- the native type of this type
-
-