001/*
002 * Copyright 2006 The Kuali Foundation
003 * 
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 * http://www.opensource.org/licenses/ecl2.php
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.ole.gl.businessobject;
017
018import org.kuali.rice.core.api.util.type.KualiDecimal;
019
020/**
021 * This class represents origin entry statistics for debit, credit, and budget total amounts 
022 */
023public class OriginEntryStatistics {
024    private KualiDecimal debitTotalAmount = KualiDecimal.ZERO;
025    private KualiDecimal creditTotalAmount = KualiDecimal.ZERO;
026    private KualiDecimal budgetTotalAmount = KualiDecimal.ZERO;
027    private Integer rowCount = 0;
028
029    public void addDebit(KualiDecimal d) {
030        if (d != null) {
031            debitTotalAmount = debitTotalAmount.add(d);
032        }
033    }
034
035    public void addCredit(KualiDecimal c) {
036        if (c != null) {
037            creditTotalAmount = creditTotalAmount.add(c);
038        }
039    }
040
041    public void addBudget(KualiDecimal b) {
042        if (b != null) {
043            budgetTotalAmount = budgetTotalAmount.add(b);
044        }
045    }
046
047    public void incrementCount() {
048        rowCount++;
049    }
050
051    public KualiDecimal getCreditTotalAmount() {
052        return creditTotalAmount;
053    }
054
055    public void setCreditTotalAmount(KualiDecimal creditTotalAmount) {
056        this.creditTotalAmount = creditTotalAmount;
057    }
058
059    public KualiDecimal getDebitTotalAmount() {
060        return debitTotalAmount;
061    }
062
063    public void setDebitTotalAmount(KualiDecimal debitTotalAmount) {
064        this.debitTotalAmount = debitTotalAmount;
065    }
066
067    public KualiDecimal getBudgetTotalAmount() {
068        return budgetTotalAmount;
069    }
070
071    public void setBudgetTotalAmount(KualiDecimal budgetTotalAmount) {
072        this.budgetTotalAmount = budgetTotalAmount;
073    }
074
075    public Integer getRowCount() {
076        return rowCount;
077    }
078
079    public void setRowCount(Integer rowCount) {
080        this.rowCount = rowCount;
081    }
082}