public class DBsparsevec extends DBobject implements DBBinaryObject, Serializable, Cloneable
| 构造器和说明 |
|---|
DBsparsevec() |
DBsparsevec(float[] v)
使用数组创建 sparsevec
|
DBsparsevec(List<T> v)
使用 list 创建 sparsevec
|
DBsparsevec(Map<Integer,T> map,
int dimensions)
使用一个没有空元素的 map 创建 sparsevec
|
DBsparsevec(String s)
使用 String 创建一个 sparsevec
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getDimensions()
返回维度的数量
|
int[] |
getIndices()
返回非零索引值
|
String |
getValue()
以字符串的形式返回 sparsevec 的值
|
float[] |
getValues()
返回非零值
|
int |
lengthInBytes()
以二进制形式输出一个向量的表示
|
void |
setByteValue(byte[] value,
int offset)
根据稀疏向量的二进制表示设置其值
|
void |
setValue(String s)
使用 String 设置 sparsevec 的值
|
float[] |
toArray()
返回数组
|
void |
toBytes(byte[] bytes,
int offset)
以二进制形式输出一个向量的表示.
|
public DBsparsevec()
public DBsparsevec(float[] v)
public DBsparsevec(List<T> v)
public DBsparsevec(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 int getDimensions()
public int[] getIndices()
public float[] getValues()
Copyright © 2026. All rights reserved.