com.eggwifi.data800.util
接口 EnumIntegerCode
- 所有已知实现类:
- Code, Scope
public interface EnumIntegerCode
代码为整型的枚举型接口。
使用例子:
public enum NumberType implements EnumIntegerCode
{
// 集团编码。
ENTERPRISE
{
public int getCode()
{
return 1;
}
},
// 成员。
PERSONAL
{
public int getCode()
{
return 2;
}
},
UNKNOWN
{
public int getCode()
{
return 0;
}
};
// 通过整型值获取指定类型。
public static NumberType get(int code)
{
for (NumberType val : NumberType.values())
{
if (val.getCode() == code)
{
return val;
}
}
return UNKNOWN;
}
}
- 作者:
- hyn
getCode
int getCode()
- 返回枚举型代码值。
- 返回:
Copyright © 2016. All rights reserved.