|
From: Hirzel P. <ph...@us...> - 2005-12-28 11:54:29
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17144/src/org/tcotool/tools Modified Files: Calculator.java Log Message: Refactoring: CostType replaced CostCause Index: Calculator.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/Calculator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Calculator.java 14 Dec 2005 13:20:39 -0000 1.2 --- Calculator.java 28 Dec 2005 11:54:19 -0000 1.3 *************** *** 47,51 **** // undefined Codes ! public static final String COST_TYPE_UNDEFINED = "COST_TYPE_UNDEFINED"; public static final String PROCESS_UNDEFINED = "UNDEFINED_PROCESS"; public static final String CATEGORY_UNDEFINED = "UNDEFINED_CATEGORY"; --- 47,51 ---- // undefined Codes ! public static final String COST_CAUSE_UNDEFINED = "COST_CAUSE_UNDEFINED"; public static final String PROCESS_UNDEFINED = "UNDEFINED_PROCESS"; public static final String CATEGORY_UNDEFINED = "UNDEFINED_CATEGORY"; *************** *** 562,568 **** // Cost codes ! key = COST_TYPE_UNDEFINED; ! if (cost.getType() != null) { ! key = cost.getType(); } storeIntoCodeList(serviceMap, kind, key, year, amount); --- 562,568 ---- // Cost codes ! key = COST_CAUSE_UNDEFINED; ! if (cost.getCause() != null) { ! key = cost.getCause(); } storeIntoCodeList(serviceMap, kind, key, year, amount); *************** *** 675,683 **** try { // use the specific code (CostType) to calculate sum ! Iterator codes = rootObject.getObjectServer().retrieveCodes(CostType.class).iterator(); while (codes.hasNext()) { cummulateLists(results, getCosts(object, kind, codes.next())); } ! cummulateLists(results, getCosts(object, kind, COST_TYPE_UNDEFINED)); } catch(Throwable e) { throw new UserException(this, "getTotal()", "Kostentyp-Code: " + e.getLocalizedMessage(), "Fehler bei der Berechnung", e); --- 675,683 ---- try { // use the specific code (CostType) to calculate sum ! Iterator codes = rootObject.getObjectServer().retrieveCodes(CostCause.class).iterator(); while (codes.hasNext()) { cummulateLists(results, getCosts(object, kind, codes.next())); } ! cummulateLists(results, getCosts(object, kind, COST_CAUSE_UNDEFINED)); } catch(Throwable e) { throw new UserException(this, "getTotal()", "Kostentyp-Code: " + e.getLocalizedMessage(), "Fehler bei der Berechnung", e); *************** *** 747,754 **** */ public Map getTcoCodeBlock(TcoObject object, List codes) { ! TcoObject costObject = (object == null ? rootObject : object); Map map = new HashMap(); ! // use the specific code (CostType) to calculate sum Iterator iterator = codes.iterator(); while (iterator.hasNext()) { --- 747,754 ---- */ public Map getTcoCodeBlock(TcoObject object, List codes) { ! // TcoObject costObject = (object == null ? rootObject : object); Map map = new HashMap(); ! // use the specific code (CostCause) to calculate sum Iterator iterator = codes.iterator(); while (iterator.hasNext()) { |