home *** CD-ROM | disk | FTP | other *** search
- package org.apache.cocoon.forms.samples;
-
- public class Sex {
- public static final Sex MALE = new Sex("M");
- public static final Sex FEMALE = new Sex("F");
- private String code;
-
- private Sex(String code) {
- this.code = code;
- }
-
- public String toString() {
- switch (this.code.charAt(0)) {
- case 'F':
- return this.getClass().getName() + ".FEMALE";
- case 'M':
- return this.getClass().getName() + ".MALE";
- default:
- return "unknown";
- }
- }
- }
-