Package org.bson
Enum Class BinaryVector.DataType
- All Implemented Interfaces:
Serializable
,Comparable<BinaryVector.DataType>
,java.lang.constant.Constable
- Enclosing class:
- BinaryVector
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA FLOAT32 vector is a vector of 32-bit floating-point numbers, where each element in the vector is a float.An INT8 vector is a vector of 8-bit signed integers.A PACKED_BIT vector is a binary quantized vector where each element of a vector is represented by a single bit (0 or 1). -
Method Summary
Modifier and TypeMethodDescriptionbyte
getValue()
Returns the byte value associated with thisBinaryVector.DataType
.static BinaryVector.DataType
Returns the enum constant of this class with the specified name.static BinaryVector.DataType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
A FLOAT32 vector is a vector of 32-bit floating-point numbers, where each element in the vector is a float. -
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
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
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 nameNullPointerException
- if the argument is null
-
getValue
public byte getValue()Returns the byte value associated with thisBinaryVector.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
.
-