Enum Class CLinker.TypeKind

java.lang.Object
java.lang.Enum<CLinker.TypeKind>
jdk.incubator.foreign.CLinker.TypeKind
All Implemented Interfaces:
Serializable, Comparable<CLinker.TypeKind>, Constable
Enclosing interface:
CLinker
public static enum CLinker.TypeKind extends Enum<CLinker.TypeKind>
A C type kind. Each kind corresponds to a particular C language builtin type, and can be attached to ValueLayout instances using the MemoryLayout.withAttribute(String, Constable) in order to obtain a layout which can be classified accordingly by CLinker.downcallHandle(Addressable, MethodType, FunctionDescriptor) and CLinker.upcallStub(MethodHandle, FunctionDescriptor, ResourceScope).

Nested Class Summary

Nested classes/interfaces declared in class java.lang.Enum

Enum.EnumDesc<E extends Enum<E>>

Enum Constant Summary

Enum Constant Description
CHAR
A kind corresponding to the integral C char type
DOUBLE
A kind corresponding to the floating-point C double type
FLOAT
A kind corresponding to the floating-point C float type
INT
A kind corresponding to the integral C int type
LONG
A kind corresponding to the integral C long type
LONG_LONG
A kind corresponding to the integral C long long type
POINTER
A kind corresponding to the an integral C pointer type
SHORT
A kind corresponding to the integral C short type

Field Summary

Modifier and Type Field Description
static final String ATTR_NAME
The layout attribute name associated with this classification kind.

Method Summary

Modifier and Type Method Description
boolean isFloat()
Is this kind a floating point type?
boolean isIntegral()
Is this kind integral?
boolean isPointer()
Is this kind a pointer kind?
static CLinker.TypeKind valueOf(String name)
Returns the enum constant of this class with the specified name.
static CLinker.TypeKind[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

Methods declared in class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Details

CHAR

public static final CLinker.TypeKind CHAR
A kind corresponding to the integral C char type

SHORT

public static final CLinker.TypeKind SHORT
A kind corresponding to the integral C short type

INT

public static final CLinker.TypeKind INT
A kind corresponding to the integral C int type

LONG

public static final CLinker.TypeKind LONG
A kind corresponding to the integral C long type

LONG_LONG

public static final CLinker.TypeKind LONG_LONG
A kind corresponding to the integral C long long type

FLOAT

public static final CLinker.TypeKind FLOAT
A kind corresponding to the floating-point C float type

DOUBLE

public static final CLinker.TypeKind DOUBLE
A kind corresponding to the floating-point C double type

POINTER

public static final CLinker.TypeKind POINTER
A kind corresponding to the an integral C pointer type

Field Details

ATTR_NAME

public static final String ATTR_NAME
The layout attribute name associated with this classification kind. Clients can retrieve the type kind of a layout using the following code:

        ValueLayout layout = ...
        TypeKind = layout.attribute(TypeKind.ATTR_NAME).orElse(null);
 
See Also:

Method Details

values

public static CLinker.TypeKind[] values()
Returns an array containing the constants of this enum class, in the order they are declared.
Returns:
an array containing the constants of this enum class, in the order they are declared

valueOf

public static CLinker.TypeKind valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
NullPointerException - if the argument is null

isIntegral

public boolean isIntegral()
Is this kind integral?
Returns:
true if this kind is integral

isFloat

public boolean isFloat()
Is this kind a floating point type?
Returns:
true if this kind is a floating point type

isPointer

public boolean isPointer()
Is this kind a pointer kind?
Returns:
true if this kind is a pointer kind

© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/jdk.incubator.foreign/jdk/incubator/foreign/CLinker.TypeKind.html