不知道C语言的具体格式是什么,我是做java的,但是枚举基本上都是相同的
package cn.com.his.model.constants;
import java.util.ArrayList;
import java.util.List;
/**
* 六分钟心律失常
*
*
*
*/
public enum LfzXlscEnum
{
offxzb(1, "偶发房性早搏 "), pffxzb(2, "频发房性早搏 "),ofsxzb(3,"偶发室性早搏"),pfsxzb(4,"频发室性早搏"),qt(99, "其他");
private int type;
private String mean;
public int getType()
{
return type;
}
public void setType(int type)
{
this.type = type;
}
public String getMean()
{
return mean;
}
public void setMean(String mean)
{
this.mean = mean;
}
private LfzXlscEnum(int type, String mean)
{
this.type = type;
this.mean = mean;
}
public static String getLfzXlscEnum(String type)
{
String mean="";
if(type!=null){
String[] types = type.split(",");
for (String str : types)
{
LfzXlscEnum[] arrays = LfzXlscEnum.values();
for (LfzXlscEnum bzEnum : arrays)
{
if (str.equals(bzEnum.getType()+""))
{
if(99 != bzEnum.getType()){
mean = mean + bzEnum.getMean()+";";
}
}
}
}
}
return mean;
}
public static List
{
List
LfzXlscEnum[] arrays = LfzXlscEnum.values();
for (LfzXlscEnum bzEnum : arrays)
{
list.add(bzEnum);
}
return list;
}
}
枚举变量本质上还是一个整数类型,用%d