Partager via


RangeIndex Class

public final class RangeIndex
extends Index

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

Constructor Summary

Constructor Description
RangeIndex(DataType dataType)

Initializes a new instance of the RangeIndex class with specified DataType.

RangeIndex(DataType dataType, int precision)

Initializes a new instance of the RangeIndex class with specified DataType and precision.

RangeIndex(String jsonString)

Initializes a new instance of the RangeIndex class with json string.

RangeIndex(JSONObject jsonObject)

Initializes a new instance of the RangeIndex class with json object.

Method Summary

Modifier and Type Method and Description
DataType getDataType()

Gets data type.

int getPrecision()

Gets precision.

void setDataType(DataType dataType)

Sets data type.

void setPrecision(int precision)

Sets precision.

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

RangeIndex

public RangeIndex(DataType dataType)

Initializes a new instance of the RangeIndex class with specified DataType.

Here is an example to instantiate RangeIndex class passing in the DataType:

RangeIndex rangeIndex = new RangeIndex(DataType.Number);

Parameters:

dataType - the data type.

RangeIndex

public RangeIndex(DataType dataType, int precision)

Initializes a new instance of the RangeIndex class with specified DataType and precision.

RangeIndex rangeIndex = new RangeIndex(DataType.Number, -1);

Parameters:

dataType - the data type of the RangeIndex
precision - the precision of the RangeIndex

RangeIndex

public RangeIndex(String jsonString)

Initializes a new instance of the RangeIndex class with json string.

Parameters:

jsonString - the json string that represents the index.

RangeIndex

public RangeIndex(JSONObject jsonObject)

Initializes a new instance of the RangeIndex class with json object.

Parameters:

jsonObject - the json object that represents the index.

Method Details

getDataType

public DataType getDataType()

Gets data type.

Returns:

the data type.

getPrecision

public int getPrecision()

Gets precision.

Returns:

the precision.

setDataType

public void setDataType(DataType dataType)

Sets data type.

Parameters:

dataType - the data type.

setPrecision

public void setPrecision(int precision)

Sets precision.

Parameters:

precision - the precision.

Applies to