Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.pjsofts.eurobudget.report
Class GrouperLib  view GrouperLib download GrouperLib.java

java.lang.Object
  extended bycom.pjsofts.eurobudget.report.GrouperLib

public class GrouperLib
extends java.lang.Object

Centralize all grouping method another idea of implementation: grouping is like a sort. Multiple level of grouping is same as multiple sort made on sublists Instead of using hashmap we may use Collections.sort(sublist) ...


Field Summary
static Grouper GROUP_CTG_GROUP
           
static Grouper GROUP_CTG_MAIN
           
static Grouper GROUP_CTG_PAIR
           
static Grouper GROUP_CTG_TYPE
          Cost/Revenues/Special
static Grouper GROUP_ENTITY
           
static Grouper GROUP_TYPE
          Payment, Virement, Related, ...
private static java.util.ResourceBundle i18n
           
 
Constructor Summary
GrouperLib()
           
 
Method Summary
static java.util.Map addOneGroupLevel(java.util.List txns, Grouper grouper)
          Group each given lists with a new grouper
static void addOneGroupLevel(java.util.Map map, Grouper grouper)
          Group each given lists with a new grouper
static java.util.List groupByForAllAccounts(com.pjsofts.eurobudget.DataModel dm, Grouper grouper)
           
static java.util.Map groupBySums(java.util.List txns, Grouper grouper)
          Grouper is equivalent of reflection on field
static java.util.List groupListBy(java.util.List txns, Grouper[] groups, boolean sum)
          Convenient method
static java.util.List groupListBy(java.util.List txns, Grouper grouper, boolean sum)
          Convenient method
static ReportGroup groupListBy(java.lang.String label, java.util.List txns, java.util.Collection collec, boolean sum)
          Convenient method
static ReportGroup groupListBy(java.lang.String label, java.util.List txns, Grouper[] groups, boolean sum)
          Convenient method
static ReportGroup groupListBy(java.lang.String label, java.util.List txns, Grouper grouper, boolean sum)
          Convenient method
static void joinSums(java.util.TreeMap map, java.util.Map map2)
          add map2 to map
static ReportGroup listToBalanceReport(java.lang.String reportLabel, java.util.List txns, int periodKind, boolean sum)
           
static java.util.List mapToListOfSums(java.util.Map map, boolean sum)
           
static java.util.List mapToReportList(java.util.Map map, boolean sum)
          Finally convert all list of map to list of Report items sorted recursive call ..
static void sumGroupLevel(java.util.Map map)
          Final grouping: convert list of txns to sums
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i18n

private static final java.util.ResourceBundle i18n

GROUP_CTG_MAIN

public static final Grouper GROUP_CTG_MAIN

GROUP_CTG_PAIR

public static final Grouper GROUP_CTG_PAIR

GROUP_ENTITY

public static final Grouper GROUP_ENTITY

GROUP_TYPE

public static final Grouper GROUP_TYPE
Payment, Virement, Related, ...


GROUP_CTG_GROUP

public static final Grouper GROUP_CTG_GROUP

GROUP_CTG_TYPE

public static final Grouper GROUP_CTG_TYPE
Cost/Revenues/Special

Constructor Detail

GrouperLib

public GrouperLib()
Method Detail

groupByForAllAccounts

public static java.util.List groupByForAllAccounts(com.pjsofts.eurobudget.DataModel dm,
                                                   Grouper grouper)

mapToListOfSums

public static java.util.List mapToListOfSums(java.util.Map map,
                                             boolean sum)

joinSums

public static void joinSums(java.util.TreeMap map,
                            java.util.Map map2)
add map2 to map


groupBySums

public static java.util.Map groupBySums(java.util.List txns,
                                        Grouper grouper)
Grouper is equivalent of reflection on field


groupListBy

public static java.util.List groupListBy(java.util.List txns,
                                         Grouper grouper,
                                         boolean sum)
Convenient method


groupListBy

public static ReportGroup groupListBy(java.lang.String label,
                                      java.util.List txns,
                                      Grouper grouper,
                                      boolean sum)
Convenient method


groupListBy

public static java.util.List groupListBy(java.util.List txns,
                                         Grouper[] groups,
                                         boolean sum)
Convenient method


groupListBy

public static ReportGroup groupListBy(java.lang.String label,
                                      java.util.List txns,
                                      java.util.Collection collec,
                                      boolean sum)
Convenient method


groupListBy

public static ReportGroup groupListBy(java.lang.String label,
                                      java.util.List txns,
                                      Grouper[] groups,
                                      boolean sum)
Convenient method


addOneGroupLevel

public static java.util.Map addOneGroupLevel(java.util.List txns,
                                             Grouper grouper)
Group each given lists with a new grouper


addOneGroupLevel

public static void addOneGroupLevel(java.util.Map map,
                                    Grouper grouper)
Group each given lists with a new grouper


sumGroupLevel

public static void sumGroupLevel(java.util.Map map)
Final grouping: convert list of txns to sums


mapToReportList

public static java.util.List mapToReportList(java.util.Map map,
                                             boolean sum)
Finally convert all list of map to list of Report items sorted recursive call ..


listToBalanceReport

public static ReportGroup listToBalanceReport(java.lang.String reportLabel,
                                              java.util.List txns,
                                              int periodKind,
                                              boolean sum)