目录

SupportedUnit

Enum Info

public enum SupportedUnit

Distance unit enumeration class.

Enum Value Summary

Enum Value and Description

METRIC(0)

Metric unit.

IMPERIAL(1)

Imperial unit.

Public Method Summary

Qualifier and Type

Method Name and Description

int

getCode()

Obtains the current distance unit code.

static SupportedUnit

getByCode(Integer unit)

Obtains the enumeration type based on the passed value.

static boolean

isSameUnit(int commonUnit, UnitEnum unit)

Checks whether two passed enumeration values are the same.

Public Methods

[h2]getCode

Method

public int getCode()

Obtains the current distance unit code.

Returns

Type

Description

int

Current distance unit code.

[h2]getByCode

Method

public static SupportedUnit getByCode(Integer unit)

Obtains the enumeration type based on the passed enumeration value.

Parameters

Name

Description

unit

Passed enumeration value.

Returns

Type

Description

SupportedUnit

Enumeration type.

[h2]isSameUnit

Method

public static boolean isSameUnit(int commonUnit, UnitEnum unit)

Checks whether two passed enumeration values are the same.

Parameters

Name

Description

commonUnit

Measurement unit. The options include METRIC(0) and IMPERIAL(1).

unit

Enumerated units.

Returns

Type

Description

boolean

Whether the two enumeration values are the same.