DailyTimesheetEntry.java :  » Project-Management » XPlanner-0.7b7 » com » technoetic » xplanner » domain » virtual » Java Open Source

Java Open Source » Project Management » XPlanner 0.7b7 
XPlanner 0.7b7 » com » technoetic » xplanner » domain » virtual » DailyTimesheetEntry.java
package com.technoetic.xplanner.domain.virtual;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DailyTimesheetEntry implements Serializable {
    private java.util.Date entryDate;
    private java.math.BigDecimal totalDuration = new BigDecimal(0.0);
    public static SimpleDateFormat shortDateFormat = new SimpleDateFormat(
            "EEE d-MMM-yy");

    public DailyTimesheetEntry() {
    }

    public DailyTimesheetEntry(Date entryDate, BigDecimal duration) {
        this.setEntryDate(entryDate);
        this.setTotalDuration(duration);
    }

    public Date getEntryDate() {
        return entryDate;
    }

    public String getEntryDateShort() {
        return shortDateFormat.format(this.getEntryDate());
    }

    public void setEntryDate(Date date) {
        this.entryDate = date;
    }

    public java.math.BigDecimal getTotalDuration() {
        return totalDuration.setScale(1, BigDecimal.ROUND_HALF_EVEN);
    }

    public void setTotalDuration(java.math.BigDecimal totalDuration) {
        this.totalDuration = totalDuration;
    }

    public void setTotalDuration(double totalDuration) {
        this.totalDuration = this.totalDuration.add(new BigDecimal(totalDuration));
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.