共用方式為


SpatialIndex Class

public final class SpatialIndex
extends Index

Represents a spatial index in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
SpatialIndex(DataType dataType)

Initializes a new instance of the SpatialIndex class.

SpatialIndex(String jsonString)

Initializes a new instance of the SpatialIndex class.

SpatialIndex(JSONObject jsonObject)

Initializes a new instance of the SpatialIndex class.

Method Summary

Modifier and Type Method and Description
DataType getDataType()

Gets data type.

void setDataType(DataType dataType)

Sets data type.

Methods inherited from Index

Methods inherited from JsonSerializable

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SpatialIndex

public SpatialIndex(DataType dataType)

Initializes a new instance of the SpatialIndex class.

Here is an example to instantiate SpatialIndex class passing in the DataType

SpatialIndex spatialIndex = new SpatialIndex(DataType.Point);

Parameters:

dataType - specifies the target data type for the index path specification.

SpatialIndex

public SpatialIndex(String jsonString)

Initializes a new instance of the SpatialIndex class.

Parameters:

jsonString - the json string that represents the index.

SpatialIndex

public SpatialIndex(JSONObject jsonObject)

Initializes a new instance of the SpatialIndex class.

Parameters:

jsonObject - the json object that represents the index.

Method Details

getDataType

public DataType getDataType()

Gets data type.

Returns:

the data type.

setDataType

public void setDataType(DataType dataType)

Sets data type.

Parameters:

dataType - the data type.

Applies to