Top Description Constructors Methods
jnr.ffi

public abstract Class Type

extends Object
Class Inheritance
Known Direct Subclasses
jnr.ffi.provider.BadType, jnr.ffi.provider.jffi.NativeRuntime.TypeDelegate, jnr.ffi.StructLayout

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 jnr.ffi.Runtime#findType(NativeType) or jnr.ffi.Runtime#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

AccessConstructor and Description
public
Type()

Method Summary

Modifier and TypeMethod and Description
public abstract int

Returns:

An integer
alignment
()

The native alignment of this type, in bytes

public abstract NativeType

Returns:

the native type of this type
getNativeType
()

The native type of this type

public abstract int

Returns:

An integer
size
()

The size in bytes of this type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Typeback to summary
public Type()

Method Detail

alignmentback to summary
public abstract int alignment()

The native alignment of this type, in bytes

Returns:int

An integer

getNativeTypeback to summary
public abstract NativeType getNativeType()

The native type of this type

Returns:NativeType

the native type of this type

sizeback to summary
public abstract int size()

The size in bytes of this type.

Returns:int

An integer