你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
HashIndex 类
- java.
lang. Object - JsonSerializable
- Index
- com.
microsoft. azure. cosmosdb. HashIndex
- com.
public class HashIndex extends Index
表示 Azure Cosmos DB 数据库服务中的哈希索引。
构造函数摘要
构造函数 | 说明 |
---|---|
HashIndex(DataType dataType) |
指定具有指定 DataType 的 HashIndex 类的实例。 下面是实例化传入 DataType 的 HashIndex 类的示例:
|
HashIndex(DataType dataType, int precision) |
使用指定的 DataType 和精度初始化 HashIndex 类的新实例。 下面是实例化传入 DataType 的 HashIndex 类的示例:
|
HashIndex(String jsonString) |
使用 json 字符串初始化 HashIndex 类的新实例。 |
方法摘要
修饰符和类型 | 方法和描述 |
---|---|
Data |
getDataType()
获取数据类型。 |
int |
getPrecision()
获取精度。 |
void |
setDataType(DataType dataType)
设置数据类型。 |
void |
setPrecision(int precision)
设置精度。 |
继承成员
构造函数详细信息
HashIndex
public HashIndex(DataType dataType)
指定具有指定 DataType 的 HashIndex 类的实例。
下面是实例化传入 DataType 的 HashIndex 类的示例:
HashIndex hashIndex = 新的 HashIndex (DataType.String) ;</code></pre></p>
Parameters:
dataType
- 数据类型。
HashIndex
public HashIndex(DataType dataType, int precision)
使用指定的 DataType 和精度初始化 HashIndex 类的新实例。
下面是实例化传入 DataType 的 HashIndex 类的示例:
HashIndex hashIndex = new HashIndex (DataType.String, 3) ;</code></pre></p>
Parameters:
dataType
- 数据类型。
precision
- 精度。
HashIndex
public HashIndex(String jsonString)
使用 json 字符串初始化 HashIndex 类的新实例。
Parameters:
jsonString
- 表示索引的 json 字符串。
方法详细信息
getDataType
public DataType getDataType()
获取数据类型。
Returns:
数据类型。
getPrecision
public int getPrecision()
获取精度。
Returns:
精度。
setDataType
public void setDataType(DataType dataType)
设置数据类型。
Parameters:
dataType
- 数据类型。
setPrecision
public void setPrecision(int precision)
设置精度。
Parameters:
precision
- 精度。
适用于