← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1814: Using concrete types for categorycombo and dataelementgroupsets in reporttable

 

------------------------------------------------------------
revno: 1814
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-04-29 18:13:46 +0200
message:
  Using concrete types for categorycombo and dataelementgroupsets in reporttable
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2010-04-28 10:36:18 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2010-04-29 16:13:46 +0000
@@ -37,6 +37,8 @@
 
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dimension.Dimension;
 import org.hisp.dhis.dimension.DimensionOption;
@@ -158,12 +160,12 @@
     /**
      * The DataElementCategoryCombo for the ReportTable.
      */
-    private DimensionSet categoryCombo;
+    private DataElementCategoryCombo categoryCombo;
     
     /**
      * The DataElementGropSets for the ReportTable.
      */
-    private List<? extends Dimension> dataElementGroupSets = new ArrayList<Dimension>();
+    private List<DataElementGroupSet> dataElementGroupSets = new ArrayList<DataElementGroupSet>();
     
     /**
      * Whether to crosstabulate on the Indicator dimension, which also represents DataElements and DataSets.
@@ -603,13 +605,14 @@
      * Sets the appropriate dimension related properties depending on the dimension 
      * set type.
      */
+    @SuppressWarnings( "unchecked" )
     public void setDimensionSet( DimensionSet dimensionSet )
     {
         if ( dimensionSet != null )
         {
             dimensionType = dimensionSet.getDimensionType().name();
-            categoryCombo = dimensionType.equals( DimensionType.CATEGORY.name() ) ? dimensionSet : null;
-            dataElementGroupSets = dimensionType.equals( DimensionType.DATAELEMENTGROUPSET.name() ) ? dimensionSet.getDimensions() : null;
+            categoryCombo = dimensionType.equals( DimensionType.CATEGORY.name() ) ? (DataElementCategoryCombo)dimensionSet : null;
+            dataElementGroupSets = dimensionType.equals( DimensionType.DATAELEMENTGROUPSET.name() ) ? (List<DataElementGroupSet>)dimensionSet.getDimensions() : null;
             
             verify( dimensionType != null, "Dimension type cannot be null" );
         }
@@ -1184,22 +1187,22 @@
         this.dimensionType = dimensionType;
     }
 
-    public DimensionSet getCategoryCombo()
+    public DataElementCategoryCombo getCategoryCombo()
     {
         return categoryCombo;
     }
 
-    public void setCategoryCombo( DimensionSet categoryCombo )
+    public void setCategoryCombo( DataElementCategoryCombo categoryCombo )
     {
         this.categoryCombo = categoryCombo;
     }
 
-    public List<? extends Dimension> getDataElementGroupSets()
+    public List<DataElementGroupSet> getDataElementGroupSets()
     {
         return dataElementGroupSets;
     }
 
-    public void setDataElementGroupSets( List<? extends Dimension> dataElementGroupSets )
+    public void setDataElementGroupSets( List<DataElementGroupSet> dataElementGroupSets )
     {
         this.dataElementGroupSets = dataElementGroupSets;
     }