01: package com.technoetic.xplanner.domain.virtual;
02:
03: import java.io.Serializable;
04: import java.math.BigDecimal;
05: import java.text.SimpleDateFormat;
06: import java.util.Date;
07:
08: public class DailyTimesheetEntry implements Serializable {
09: private java.util.Date entryDate;
10: private java.math.BigDecimal totalDuration = new BigDecimal(0.0);
11: public static SimpleDateFormat shortDateFormat = new SimpleDateFormat(
12: "EEE d-MMM-yy");
13:
14: public DailyTimesheetEntry() {
15: }
16:
17: public DailyTimesheetEntry(Date entryDate, BigDecimal duration) {
18: this .setEntryDate(entryDate);
19: this .setTotalDuration(duration);
20: }
21:
22: public Date getEntryDate() {
23: return entryDate;
24: }
25:
26: public String getEntryDateShort() {
27: return shortDateFormat.format(this .getEntryDate());
28: }
29:
30: public void setEntryDate(Date date) {
31: this .entryDate = date;
32: }
33:
34: public java.math.BigDecimal getTotalDuration() {
35: return totalDuration.setScale(1, BigDecimal.ROUND_HALF_EVEN);
36: }
37:
38: public void setTotalDuration(java.math.BigDecimal totalDuration) {
39: this .totalDuration = totalDuration;
40: }
41:
42: public void setTotalDuration(double totalDuration) {
43: this .totalDuration = this .totalDuration.add(new BigDecimal(
44: totalDuration));
45: }
46: }
|