Created
March 8, 2012 20:28
-
-
Save ubiquitousthey/2003245 to your computer and use it in GitHub Desktop.
Class to support rendering an enumeration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum ECGRhythms implements { | |
NORMAL_SINUS_RHYTHM("Normal sinus rhythm",1), | |
PACEMAKER("Pacemaker",2), | |
FREQUENT_PVCS("Frequent PVCs",3), | |
ATRIAL_FIBRILLATION("Atrial fibrillation", 5), | |
OTHER("Other", 6); | |
String display; | |
int value; | |
ECGRhythms(String display, int value) { | |
this.display = display; | |
this.value = value; | |
} | |
static List<ECGRhythms> asList() { | |
return Arrays.asList(ECGRhythms.values()); | |
} | |
public int getValue() { | |
return this.value; | |
} | |
} | |
public class Demo { | |
ValueListBox<ECGRhythm> vlb; | |
void demo() { | |
vlb = new ValueListBox<ECGRhythms>( | |
new ToStringRenderer<ECGRhythms>()); | |
vlb.setAcceptableValues(ECGRhythm.asList()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment