public class DBvector extends DBobject implements DBBinaryObject, Serializable, Cloneable
| 构造器和说明 |
|---|
DBvector() |
DBvector(float[] v)
使用数组创建 vector
|
DBvector(List<T> v)
使用 list 创建 vector
|
DBvector(String s)
使用 String 创建 vector
|
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addVectorType(Connection conn)
注册 vector 类型.
|
String |
getValue()
获取 vector 的值
|
int |
lengthInBytes()
返回二进制表示形式的字节数
|
static void |
registerTypes(Connection conn)
注册 vector、 halfvec、 sparsevec 类型.
|
void |
setByteValue(byte[] value,
int offset)
从向量的二进制表示形式设置值
|
void |
setValue(String s)
使用字符串去设置 vector 的值
|
float[] |
toArray() |
void |
toBytes(byte[] bytes,
int offset)
以二进制形式输出一个向量的表示.
|
public DBvector()
public DBvector(float[] v)
public DBvector(List<T> v)
public DBvector(String s) throws SQLException
SQLExceptionpublic void setValue(String s) throws SQLException
setValue 在类中 DBobjects - a string representation of the value of the objectSQLException - thrown if value is invalid for this typepublic String getValue()
public int lengthInBytes()
lengthInBytes 在接口中 DBBinaryObjectpublic void setByteValue(byte[] value,
int offset)
throws SQLException
setByteValue 在接口中 DBBinaryObjectvalue - data containing the binary representation of the value of the objectoffset - the offset in the byte array where object data startsSQLException - thrown if value is invalid for this typepublic void toBytes(byte[] bytes,
int offset)
toBytes 在接口中 DBBinaryObjectbytes - the array to store the value, it is guaranteed to be at lest
DBBinaryObject.lengthInBytes() in size.offset - the offset in the byte array where object must be storedpublic float[] toArray()
public static void addVectorType(Connection conn) throws SQLException
conn - connectionSQLException - exceptionpublic static void registerTypes(Connection conn) throws SQLException
conn - connectionSQLException - exceptionCopyright © 2026. All rights reserved.