001 /* 002 * Copyright 2011 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 */ 016 package org.kuali.kfs.module.endow.batch.reporter; 017 018 public class ReportDocumentStatistics { 019 020 protected int numberOfSourceTransactionLines = 0; 021 protected int numberOfTargetTransactionLines = 0; 022 023 protected int numberOfDocuments = 0; 024 protected int numberOfErrors = 0; 025 026 protected String documentTypeName; 027 028 /** 029 * Constructs a ReportDocumentStatistics.java. 030 */ 031 public ReportDocumentStatistics(String documentTypeName) { 032 this.documentTypeName = documentTypeName; 033 } 034 035 /** 036 * 037 * This returns the total number of source and target transaction lines. 038 * 039 * @return 040 */ 041 public int getTotalNumberOfTransactionLines() { 042 return numberOfSourceTransactionLines + numberOfTargetTransactionLines; 043 } 044 045 /** 046 * 047 * Increments the number of documents that were generated for this 048 * by 1. 049 * 050 */ 051 public void incrementNumberOfDocuments() { 052 this.numberOfDocuments++; 053 } 054 055 /** 056 * 057 * Adds the specified number of source transaction lines for this document. 058 * 059 * @param numberOfSourceTransactionLines 060 */ 061 public void addNumberOfSourceTransactionLines(int numberOfSourceTransactionLines) { 062 this.numberOfSourceTransactionLines += numberOfSourceTransactionLines; 063 } 064 065 /** 066 * 067 * Adds the specified number of target transaction lines for this document. 068 * 069 * @param numberOfTargetTransactionLines 070 */ 071 public void addNumberOfTargetTransactionLines(int numberOfTargetTransactionLines) { 072 this.numberOfTargetTransactionLines += numberOfTargetTransactionLines; 073 } 074 075 /** 076 * 077 * Increments the number of errors for this document by 1. 078 * 079 */ 080 public void incrementNumberOfErrors() { 081 this.numberOfErrors++; 082 } 083 084 /** 085 * Gets the numberOfDocuments attribute. 086 * @return Returns the numberOfDocuments. 087 */ 088 public int getNumberOfDocuments() { 089 return numberOfDocuments; 090 } 091 092 /** 093 * Gets the numberOfErrors attribute. 094 * @return Returns the numberOfErrors. 095 */ 096 public int getNumberOfErrors() { 097 return numberOfErrors; 098 } 099 100 /** 101 * Gets the numberOfSourceTransactionLines attribute. 102 * @return Returns the numberOfSourceTransactionLines. 103 */ 104 public int getNumberOfSourceTransactionLines() { 105 return numberOfSourceTransactionLines; 106 } 107 108 /** 109 * Gets the numberOfTargetTransactionLines attribute. 110 * @return Returns the numberOfTargetTransactionLines. 111 */ 112 public int getNumberOfTargetTransactionLines() { 113 return numberOfTargetTransactionLines; 114 } 115 116 /** 117 * Gets the documentTypeName attribute. 118 * @return Returns the documentTypeName. 119 */ 120 public String getDocumentTypeName() { 121 return documentTypeName; 122 } 123 124 }