Module jdk.incubator.vector
Package jdk.incubator.vector

# Interface VectorOperators.Conversion<E,​F>

Type Parameters:
  `E` - the boxed element type for the conversion domain type (the input lane type)
  `F` - the boxed element type for the conversion range type (the output lane type)

All Superinterfaces:
  `VectorOperators.Operator`

Enclosing class:
  VectorOperators

    public static interface VectorOperators.Conversion<E,​F>
    extends VectorOperators.Operator

Type for all lane-wise conversions on lane values, usable in expressions like `w1 = v0.``convert``(I2D, 1)`.

API Note:
  User code should not implement this interface. A future release of this type may restrict implementations to be members of the same package.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `<E,​ F> VectorOperators.Conversion<E,​F>` | `check​(Class<E> from, Class<F> to)` | Ensures that this conversion has the desired domain and range types.
  `Class<E>` | `domainType()` | The domain of this conversion, a primitive type.
  `static <E,​ F> VectorOperators.Conversion<E,​F>` | `ofCast​(Class<E> from, Class<F> to)` | The Java language assignment or casting conversion between two types.
  `static <E> VectorOperators.Conversion<E,​E>` | `ofNarrowing​(VectorOperators.Conversion<E,​?> conv)` | An in-place version of a narrowing conversion between two types.
  `static <E,​ F> VectorOperators.Conversion<E,​F>` | `ofReinterpret​(Class<E> from, Class<F> to)` | The bitwise reinterpretation between two types.
  `static <E> VectorOperators.Conversion<E,​E>` | `ofWidening​(VectorOperators.Conversion<?,​E> conv)` | An in-place version of a widening conversion between two types.
  `Class<F>` | `rangeType()` | The range of this conversion, a primitive type.

  ### Methods declared in interface jdk.incubator.vector.VectorOperators.Operator

  `arity, compatibleWith, isAssociative, isBoolean, name, operatorName`

- ## Method Details

  - ### domainType

    Class<E> domainType()
    The domain of this conversion, a primitive type.
    Returns:
      the domain of this conversion

  - ### rangeType

    Class<F> rangeType()
    The range of this conversion, a primitive type.
    Specified by:
      `rangeType` in interface `VectorOperators.Operator`
    Returns:
      the range of this conversion

  - ### check

    <E,​ F> VectorOperators.Conversion<E,​F> check​(Class<E> from, Class<F> to)
    Ensures that this conversion has the desired domain and range types.
    Type Parameters:
      `E` - the desired domain type
      `F` - the desired range type
    Parameters:
      `from` - the desired domain type
      `to` - the desired range type
    Returns:
      this conversion object, with validated domain and range

  - ### ofCast

    static <E,​ F> VectorOperators.Conversion<E,​F> ofCast​(Class<E> from, Class<F> to)
    The Java language assignment or casting conversion between two types.
    Type Parameters:
      `E` - the domain type (boxed version of a lane type)
      `F` - the range type (boxed version of a lane type)
    Parameters:
      `from` - the type of the value to convert
      `to` - the desired type after conversion
    Returns:
      a Java assignment or casting conversion

  - ### ofReinterpret

    static <E,​ F> VectorOperators.Conversion<E,​F> ofReinterpret​(Class<E> from, Class<F> to)
    The bitwise reinterpretation between two types.
    Type Parameters:
      `E` - the domain type (boxed version of a lane type)
      `F` - the range type (boxed version of a lane type)
    Parameters:
      `from` - the type of the value to reinterpret
      `to` - the desired type after reinterpretation
    Returns:
      a bitwise reinterpretation conversion

  - ### ofNarrowing

    static <E> VectorOperators.Conversion<E,​E> ofNarrowing​(VectorOperators.Conversion<E,​?> conv)
    An in-place version of a narrowing conversion between two types. The output of the conversion must be no larger than the type `E`. Any unused lane bits are ignored and overwritten by zero bits (not a copied sign bit).
    Type Parameters:
      `E` - the domain and range type (boxed version of a lane type)
    Parameters:
      `conv` - the narrowing conversion to treat in-place
    Returns:
      a Java narrowing conversion, stored back to the original lane of type `E`

  - ### ofWidening

    static <E> VectorOperators.Conversion<E,​E> ofWidening​(VectorOperators.Conversion<?,​E> conv)
    An in-place version of a widening conversion between two types. The input of the conversion must be no larger than the type `E`. Any unused lane bits are ignored and overwritten by the result.
    Type Parameters:
      `E` - the domain and range type (boxed version of a lane type)
    Parameters:
      `conv` - the widening conversion to treat in-place
    Returns:
      a Java widening conversion, loading its input from same lane of type `E`