1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
package Pdapilot.appointment;
public class repeat {
private int idx;
final static private String[] names =
{ "None", "Daily", "Weekly", "MonthlyByDay", "MonthlyByDate", "Yearly" };
public static repeat None = new repeat(0);
public static repeat Daily = new repeat(1);
public static repeat Weekly = new repeat(2);
public static repeat MonthlyByDay = new repeat(3);
public static repeat MonthlyByDate = new repeat(4);
public static repeat Yearly = new repeat(5);
private static repeat[] objs;
private repeat(int value) {
this.idx = value;
}
public static repeat get(int value) {
return objs[value];
}
public static repeat get(String value) {
int i;
for(i=0;i<names.length;i++)
if (names[i].equals(value))
return objs[i];
return null;
}
public static String[] getNames() {
return names;
}
public String toString() {
return "repeat."+names[idx];
}
public int getValue() {
return idx;
}
public String getName() {
return names[idx];
}
static {
objs = new repeat[6];
objs[0] = repeat.None;
objs[1] = repeat.Daily;
objs[2] = repeat.Weekly;
objs[3] = repeat.MonthlyByDay;
objs[4] = repeat.MonthlyByDate;
objs[5] = repeat.Yearly;
}
};
|