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 Constants
    Enum Constant
    Description
    A kind corresponding to the integral C char type
    A kind corresponding to the floating-point C double type
    A kind corresponding to the floating-point C float type
    A kind corresponding to the integral C int type
    A kind corresponding to the integral C long type
    A kind corresponding to the integral C long long type
    A kind corresponding to the an integral C pointer type
    A kind corresponding to the integral C short type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The layout attribute name associated with this classification kind.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Is this kind a floating point type?
    boolean
    Is this kind integral?
    boolean
    Is this kind a pointer kind?
    Returns the enum constant of this class with the specified name.
    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