Suppose the file
Day.java
contains:
0523: public enum Day // Day.java
0524: {
0525: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday;
0526: public String toString()
0527: {
0528: return super.toString().substring(0, 3);
0529: }
0530: private static Day[] iDayValues = Day.values();
0531: public static Day getFirst()
0532: {
0533: return iDayValues[0];
0534: }
0535: public boolean isLast()
0536: {
0537: return this==iDayValues[iDayValues.length - 1];
0538: }
0539: public Day getNext()
0540: {
0541: int tNewPos = ordinal() + 1;
0542: if (tNewPos==iDayValues.length)
0543: return iDayValues[0];
0544: else
0545: return iDayValues[tNewPos];
0546: }
0547: }