- java.lang.Object
-
- microsoft.sql.Vector
-
- All Implemented Interfaces:
Serializable
public final class Vector extends Object implements Serializable
Represents a SQL ServerVECTORdata type value. A vector stores a fixed-length array of floating-point values, with support forFLOAT32(32-bit) andFLOAT16(16-bit half-precision) element types. Example usage:Float[] data = new Float[] { 0.1f, 0.2f, 0.3f }; Vector vector = new Vector(3, VectorDimensionType.FLOAT32, data); pstmt.setObject(1, vector, microsoft.sql.Types.VECTOR);- Since:
- 13.3.2
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVector.VectorDimensionType
-
Constructor Summary
Constructors Constructor Description Vector(int precision, int scale, Object[] data)Constructor for Vector with precision and scale value.Vector(int dimensionCount, Vector.VectorDimensionType vectorType, Object[] data)Constructor for Vector with dimension count and vector type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]getData()Returns the data of the vector.intgetDimensionCount()Returns the number of dimensions in the vector.Vector.VectorDimensionTypegetVectorDimensionType()Returns the type of the vector.StringtoString()Converts the vector to a string representation.
-
-
-
Constructor Detail
-
Vector
public Vector(int dimensionCount, Vector.VectorDimensionType vectorType, Object[] data)Constructor for Vector with dimension count and vector type.- Parameters:
dimensionCount- The number of dimensions in the vector.vectorType- The type of the vector.data- The vector data. Must beFloat[]ornull.
-
Vector
public Vector(int precision, int scale, Object[] data)Constructor for Vector with precision and scale value.- Parameters:
precision- The number of dimensions in the vector.scale- The scale value of the vector (4 for FLOAT32, 2 for FLOAT16).data- The vector data. Must beFloat[]ornull.
-
-
Method Detail
-
getData
public Object[] getData()
Returns the data of the vector.- Returns:
- The vector data as
Float[], ornull.
-
getDimensionCount
public int getDimensionCount()
Returns the number of dimensions in the vector.- Returns:
- The dimension count of the vector.
-
getVectorDimensionType
public Vector.VectorDimensionType getVectorDimensionType()
Returns the type of the vector.- Returns:
- The vector dimension type.
-
-