Enum Info |
|---|
public enum SupportedUnit 距离单位类型枚举类。 |
Qualifier and Type | Method Name and Description |
|---|---|
int | getCode() 获取当前距离单位的类型值。 |
static SupportedUnit | getByCode(Integer unit) 根据传入的枚举值获取对应的枚举类型。 |
static boolean | isSameUnit(int commonUnit, UnitEnum unit) 判断传入的两个枚举值是否相同。 |
Method |
|---|
public int getCode() 您调用此API可以获取当前距离单位的类型值。 |
Returns
Type | Description |
|---|---|
int | 返回当前距离单位的类型值。 |
Method |
|---|
public static SupportedUnit getByCode(Integer unit) 您调用此API可以根据传入的枚举值获取对应的枚举类型。 |
Parameters
Name | Description |
|---|---|
unit | 传入的枚举值。 |
Returns
Type | Description |
|---|---|
返回枚举类型。 |
Method |
|---|
public static boolean isSameUnit(int commonUnit, UnitEnum unit) 您调用此API可以判断传入的两个枚举值是否相同。 |
Parameters
Name | Description |
|---|---|
commonUnit | 单位(METRIC(0):公制 ,IMPERIAL(1):英制)。 |
unit | 枚举单位。 |
Returns
Type | Description |
|---|---|
boolean | 比对的boolean值。 |