Package org.bson

Enum Class BinaryVector.DataType

java.lang.Object
java.lang.Enum<BinaryVector.DataType>
org.bson.BinaryVector.DataType
All Implemented Interfaces:
Serializable, Comparable<BinaryVector.DataType>, java.lang.constant.Constable
Enclosing class:
BinaryVector

public static enum BinaryVector.DataType extends Enum<BinaryVector.DataType>
Represents the data type (dtype) of a vector.

Each dtype determines how the data in the vector is stored, including how many bits are used to represent each element in the vector.

Since:
5.3
Since server release
6.0
  • Enum Constant Details

    • INT8

      public static final BinaryVector.DataType INT8
      An INT8 vector is a vector of 8-bit signed integers. The vector is stored as an array of bytes, where each byte represents a signed integer in the range [-128, 127].
    • FLOAT32

      public static final BinaryVector.DataType FLOAT32
      A FLOAT32 vector is a vector of 32-bit floating-point numbers, where each element in the vector is a float.
    • PACKED_BIT

      public static final BinaryVector.DataType PACKED_BIT
      A PACKED_BIT vector is a binary quantized vector where each element of a vector is represented by a single bit (0 or 1). Each byte can hold up to 8 bits (vector elements).
  • Method Details

    • values

      public static BinaryVector.DataType[] 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 BinaryVector.DataType 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
    • getValue

      public byte getValue()
      Returns the byte value associated with this BinaryVector.DataType.

      This value is used in the BSON binary format to indicate the data type of the vector.

      Returns:
      the byte value representing the BinaryVector.DataType.