org.kuali.kfs.module.ec.util
Class LedgerBalanceConsolidationHelper

java.lang.Object
  extended by org.kuali.kfs.module.ec.util.LedgerBalanceConsolidationHelper

public class LedgerBalanceConsolidationHelper
extends Object

To provide a set of utilities to consolidate/group the specified ledger balances and build a returning ledger balance Map.


Constructor Summary
LedgerBalanceConsolidationHelper()
           
 
Method Summary
static void addLedgerBalanceAmounts(LaborLedgerBalance ledgerBalance, LaborLedgerBalance anotherLedgerBalance)
          add the monthly amounts of the second ledger balance with those of the first one
static org.kuali.rice.kns.util.KualiDecimal calculateTotalAmountWithinReportPeriod(Collection<LaborLedgerBalance> ledgerBalances, Map<Integer,Set<String>> reportPeriods)
          summurize the balance amounts of the given ledger balances within the specified report periods
static org.kuali.rice.kns.util.KualiDecimal calculateTotalAmountWithinReportPeriod(LaborLedgerBalance ledgerBalance, Map<Integer,Set<String>> reportPeriods)
          summurize the balance amounts of a given ledger balance within the specified report periods
static void consolidateLedgerBalances(Map<String,LaborLedgerBalance> ledgerBalanceMap, Collection<LaborLedgerBalance> ledgerBalances, List<String> consolidationKeys)
          consolidate the amounts of the given ledger balances into the balances with the same values of specified key fields
static void consolidateLedgerBalances(Map<String,LaborLedgerBalance> ledgerBalanceMap, LaborLedgerBalance ledgerBalance, List<String> consolidationKeys)
          consolidate the amount of the given ledger balance into the balance with the same values of specified key fields
static void consolidateLedgerBalances(Map<String,LaborLedgerBalance> ledgerBalanceMap, LaborLedgerBalance ledgerBalance, String consolidationKeyFieldsAsString)
          consolidate the amount of the given ledger balance into the balance with the same values of specified key fields
static void groupLedgerBalancesByKeys(Map<String,List<LaborLedgerBalance>> ledgerBalanceMap, Collection<LaborLedgerBalance> ledgerBalances, List<String> consolidationKeys)
          group the given ledger balances into the lists of balances with the same values of specified key fields
static void groupLedgerBalancesByKeys(Map<String,List<LaborLedgerBalance>> ledgerBalanceMap, LaborLedgerBalance ledgerBalance, List<String> consolidationKeys)
          group the given ledger balance into the list of balances with the same values of specified key fields
static void groupLedgerBalancesByKeys(Map<String,List<LaborLedgerBalance>> ledgerBalanceMap, LaborLedgerBalance ledgerBalance, String consolidationKeyFieldsAsString)
          group the given ledger balance into the list of balances with the same values of specified key fields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LedgerBalanceConsolidationHelper

public LedgerBalanceConsolidationHelper()
Method Detail

consolidateLedgerBalances

public static void consolidateLedgerBalances(Map<String,LaborLedgerBalance> ledgerBalanceMap,
                                             LaborLedgerBalance ledgerBalance,
                                             List<String> consolidationKeys)
consolidate the amount of the given ledger balance into the balance with the same values of specified key fields

Parameters:
ledgerBalanceMap - the hash map that contains the consolidated balance records. Its key can be the combined string value of the given consolidation keys.
ledgerBalance - the given ledger balance to be consolidated
consolidationKeys - the given key field names used to build the keys of ledgerBalanceMap

consolidateLedgerBalances

public static void consolidateLedgerBalances(Map<String,LaborLedgerBalance> ledgerBalanceMap,
                                             LaborLedgerBalance ledgerBalance,
                                             String consolidationKeyFieldsAsString)
consolidate the amount of the given ledger balance into the balance with the same values of specified key fields

Parameters:
ledgerBalanceMap - the hash map that contains the consolidated balance records. Its key can be the combined string value of the given consolidation keys.
ledgerBalance - the given ledger balance to be consolidated
consolidationKeys - the given key field names used to build the keys of ledgerBalanceMap

consolidateLedgerBalances

public static void consolidateLedgerBalances(Map<String,LaborLedgerBalance> ledgerBalanceMap,
                                             Collection<LaborLedgerBalance> ledgerBalances,
                                             List<String> consolidationKeys)
consolidate the amounts of the given ledger balances into the balances with the same values of specified key fields

Parameters:
ledgerBalanceMap - the hash map that contains the consolidated balance records. Its key can be the combined string value of the given consolidation keys.
ledgerBalances - the given ledger balances to be consolidated
consolidationKeys - the given key field names used to build the keys of ledgerBalanceMap

groupLedgerBalancesByKeys

public static void groupLedgerBalancesByKeys(Map<String,List<LaborLedgerBalance>> ledgerBalanceMap,
                                             LaborLedgerBalance ledgerBalance,
                                             List<String> consolidationKeys)
group the given ledger balance into the list of balances with the same values of specified key fields

Parameters:
ledgerBalanceMap - the hash map that contains a set of ledger balance lists. Its key can be the combined string value of the given consolidation keys.
ledgerBalance - the given ledger balance to be grouped
consolidationKeys - the given key field names used to build the keys of ledgerBalanceMap

groupLedgerBalancesByKeys

public static void groupLedgerBalancesByKeys(Map<String,List<LaborLedgerBalance>> ledgerBalanceMap,
                                             LaborLedgerBalance ledgerBalance,
                                             String consolidationKeyFieldsAsString)
group the given ledger balance into the list of balances with the same values of specified key fields

Parameters:
ledgerBalanceMap - the hash map that contains a set of ledger balance lists. Its key can be the combined string value of the given consolidation keys.
ledgerBalance - the given ledger balance to be grouped
consolidationKeys - the given key field names used to build the keys of ledgerBalanceMap

groupLedgerBalancesByKeys

public static void groupLedgerBalancesByKeys(Map<String,List<LaborLedgerBalance>> ledgerBalanceMap,
                                             Collection<LaborLedgerBalance> ledgerBalances,
                                             List<String> consolidationKeys)
group the given ledger balances into the lists of balances with the same values of specified key fields

Parameters:
ledgerBalanceMap - the hash map that contains a set of ledger balance lists. Its key can be the combined string value of the given consolidation keys.
ledgerBalance - the given ledger balances to be grouped
consolidationKeys - the given key field names used to build the keys of ledgerBalanceMap

addLedgerBalanceAmounts

public static void addLedgerBalanceAmounts(LaborLedgerBalance ledgerBalance,
                                           LaborLedgerBalance anotherLedgerBalance)
add the monthly amounts of the second ledger balance with those of the first one

Parameters:
ledgerBalance - the given ledger balance, which holds the summerized monthly amounts
anotherLedgerBalance - the given ledger balance, which contributes monthly amounts

calculateTotalAmountWithinReportPeriod

public static org.kuali.rice.kns.util.KualiDecimal calculateTotalAmountWithinReportPeriod(LaborLedgerBalance ledgerBalance,
                                                                                          Map<Integer,Set<String>> reportPeriods)
summurize the balance amounts of a given ledger balance within the specified report periods

Parameters:
ledgerBalance - the given labor ledger balance
reportPeriods - the given report periods
Returns:
the total amounts of the given balance within the specified report periods

calculateTotalAmountWithinReportPeriod

public static org.kuali.rice.kns.util.KualiDecimal calculateTotalAmountWithinReportPeriod(Collection<LaborLedgerBalance> ledgerBalances,
                                                                                          Map<Integer,Set<String>> reportPeriods)
summurize the balance amounts of the given ledger balances within the specified report periods

Parameters:
ledgerBalance - the given labor ledger balances
reportPeriods - the given report periods
Returns:
the total amounts of the given balances within the specified report periods


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.