目录

SupportedUnit

Enum Info

public enum SupportedUnit

距离单位类型枚举类。

Enum Value Summary

Enum Value and Description

METRIC(0)

公制。

IMPERIAL(1)

英制。

Public Method Summary

Qualifier and Type

Method Name and Description

int

getCode()

获取当前距离单位的类型值。

static SupportedUnit

getByCode(Integer unit)

根据传入的枚举值获取对应的枚举类型。

static boolean

isSameUnit(int commonUnit, UnitEnum unit)

判断传入的两个枚举值是否相同。

Public Methods

[h2]getCode

Method

public int getCode()

您调用此API可以获取当前距离单位的类型值。

Returns

Type

Description

int

返回当前距离单位的类型值。

[h2]getByCode

Method

public static SupportedUnit getByCode(Integer unit)

您调用此API可以根据传入的枚举值获取对应的枚举类型。

Parameters

Name

Description

unit

传入的枚举值。

Returns

Type

Description

SupportedUnit

返回枚举类型。

[h2]isSameUnit

Method

public static boolean isSameUnit(int commonUnit, UnitEnum unit)

您调用此API可以判断传入的两个枚举值是否相同。

Parameters

Name

Description

commonUnit

单位(METRIC(0):公制 ,IMPERIAL(1):英制)。

unit

枚举单位。

Returns

Type

Description

boolean

比对的boolean值。