home *** CD-ROM | disk | FTP | other *** search
- package org.apache.cocoon.forms.samples.bindings;
-
- import java.util.HashMap;
- import java.util.Map;
- import java.util.StringTokenizer;
-
- public class DateWrapper {
- private Map split = new HashMap();
-
- public DateWrapper(String day, String month, String year) {
- this.setDay(day);
- this.setMonth(month);
- this.setYear(year);
- }
-
- public String getCombined() {
- return "" + this.getDay() + "/" + this.getMonth() + "/" + this.getYear();
- }
-
- public void setCombined(String fullDate) {
- StringTokenizer st = new StringTokenizer(fullDate, "/");
- this.setDay(st.nextToken());
- this.setMonth(st.nextToken());
- this.setYear(st.nextToken());
- }
-
- public Map getSplit() {
- return this.split;
- }
-
- public String getDay() {
- return this.split.get("day").toString();
- }
-
- public void setDay(String day) {
- this.split.put("day", day);
- }
-
- public String getMonth() {
- return this.split.get("month").toString();
- }
-
- public void setMonth(String month) {
- this.split.put("month", month);
- }
-
- public String getYear() {
- return this.split.get("year").toString();
- }
-
- public void setYear(String year) {
- this.split.put("year", year);
- }
-
- public String toString() {
- return "Wrapped Date as combined='" + this.getCombined() + "' as split=[" + this.getDay() + ", " + this.getMonth() + ", " + this.getYear() + "]";
- }
- }
-