Class Species<E>

  • Type Parameters:
    E - the boxed element type of this species

    public abstract class Species<E>
    extends Object
    Class representing vectors of same element type, E and Shape.
    • Method Summary

      Modifier and Type Method Description
      int bitSize()
      Returns the total vector size, in bits, of vectors produced by this species.
      abstract int elementSize()
      Returns the element size, in bits, of vectors produced by this species.
      abstract Class<E> elementType()
      Returns the primitive element type of vectors produced by this species.
      abstract Shape indexShape()
      Returns the shape of the corresponding index species
      int length()
      Returns the mask, shuffe, or vector lanes produced by this species.
      static <E> Species<E> of​(Class<E> c, Shape s)
      Finds a species for an element type and shape.
      static <E> Species<E> ofPreferred​(Class<E> c)
      Finds a preferred species for an element type.
      abstract Shape shape()
      Returns the shape of masks, shuffles, and vectors produced by this species.
    • Method Detail

      • elementType

        public abstract Class<E> elementType()
        Returns the primitive element type of vectors produced by this species.
        Returns:
        the primitive element type
      • elementSize

        public abstract int elementSize()
        Returns the element size, in bits, of vectors produced by this species.
        Returns:
        the element size, in bits
      • shape

        public abstract Shape shape()
        Returns the shape of masks, shuffles, and vectors produced by this species.
        Returns:
        the primitive element type
      • indexShape

        public abstract Shape indexShape()
        Returns the shape of the corresponding index species
        Returns:
        the shape
      • length

        public int length()
        Returns the mask, shuffe, or vector lanes produced by this species.
        Returns:
        the the number of lanes
      • bitSize

        public int bitSize()
        Returns the total vector size, in bits, of vectors produced by this species.
        Returns:
        the total vector size, in bits
      • of

        public static <E> Species<E> of​(Class<E> c,
                                        Shape s)
        Finds a species for an element type and shape.
        Type Parameters:
        E - the boxed element type
        Parameters:
        c - the element type
        s - the shape
        Returns:
        a species for an element type and shape
        Throws:
        IllegalArgumentException - if no such species exists for the element type and/or shape
      • ofPreferred

        public static <E> Species<E> ofPreferred​(Class<E> c)
        Finds a preferred species for an element type.

        A preferred species is a species chosen by the platform that has a shape of maximal bit size. A preferred species for different element types will have the same shape, and therefore vectors created from such species will be shape compatible.

        Type Parameters:
        E - the boxed element type
        Parameters:
        c - the element type
        Returns:
        a preferred species for an element type
        Throws:
        IllegalArgumentException - if no such species exists for the element type