diff options
Diffstat (limited to 'src/com/google/wireless/gdata/calendar/data/When.java')
-rw-r--r-- | src/com/google/wireless/gdata/calendar/data/When.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/com/google/wireless/gdata/calendar/data/When.java b/src/com/google/wireless/gdata/calendar/data/When.java new file mode 100644 index 0000000..4f9ab9e --- /dev/null +++ b/src/com/google/wireless/gdata/calendar/data/When.java @@ -0,0 +1,53 @@ +// Copyright 2007 The Android Open Source Project +package com.google.wireless.gdata.calendar.data; + +import com.google.wireless.gdata.data.StringUtils; + +/** + * Contains information about the start and end of an instance of an event. + */ +public class When { + private final String startTime; + private final String endTime; + + /** + * Creates a new When. + * @param startTime The start of the event. + * @param endTime The end of the event. + */ + public When(String startTime, String endTime) { + this.startTime = startTime; + this.endTime = endTime; + } + + /** + * Returns the start time for the event. + * @return The start time for the event. + */ + public String getStartTime() { + return startTime; + } + + /** + * Returns the end time for the event. + * @return The end time for the event. + */ + public String getEndTime() { + return endTime; + } + + public void toString(StringBuffer sb) { + if (!StringUtils.isEmpty(startTime)) { + sb.append("START TIME: " + startTime + "\n"); + } + if (!StringUtils.isEmpty(endTime)) { + sb.append("END TIME: " + endTime + "\n"); + } + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + toString(sb); + return sb.toString(); + } +} |