dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18808
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7983: Codestyle fix and removed unused method
------------------------------------------------------------
revno: 7983
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-08-29 16:44:51 +0200
message:
Codestyle fix and removed unused method
modified:
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/AggregationCache.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/MemoryAggregationCache.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageBoolAggregator.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageIntAggregator.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumBoolAggregator.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumIntAggregator.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/dataelement/DefaultDataElementDataMart.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-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/AggregationCache.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/AggregationCache.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/AggregationCache.java 2012-08-29 14:44:51 +0000
@@ -33,7 +33,6 @@
import org.hisp.dhis.dataelement.DataElementOperand;
import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodType;
/**
* @author Lars Helge Overland
@@ -45,8 +44,6 @@
Collection<Integer> getPeriodsBetweenDates( Date startDate, Date endDate );
- Collection<Integer> getPeriodsBetweenDatesPeriodType( PeriodType periodType, Date startDate, Date endDate );
-
Period getPeriod( int id );
int getLevelOfOrganisationUnit( int id );
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/MemoryAggregationCache.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/MemoryAggregationCache.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/cache/MemoryAggregationCache.java 2012-08-29 14:44:51 +0000
@@ -38,7 +38,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.system.util.ConversionUtils;
/**
@@ -121,24 +120,6 @@
return periods;
}
- public Collection<Integer> getPeriodsBetweenDatesPeriodType( final PeriodType periodType, final Date startDate, final Date endDate ) //TODO remove?
- {
- final String key = periodType.getName() + SEPARATOR + startDate.toString() + SEPARATOR + endDate.toString();
-
- Collection<Integer> periods = null;
-
- if ( ( periods = periodBetweenDatesPeriodTypeCache.get( key ) ) != null )
- {
- return periods;
- }
-
- periods = ConversionUtils.getIdentifiers( Period.class, periodService.getPeriodsBetweenDates( periodType, startDate, endDate ) );
-
- periodBetweenDatesPeriodTypeCache.put( key, periods );
-
- return periods;
- }
-
public Period getPeriod( final int id )
{
final String key = String.valueOf( id );
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageBoolAggregator.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageBoolAggregator.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageBoolAggregator.java 2012-08-29 14:44:51 +0000
@@ -139,7 +139,16 @@
return values;
}
-
+
+ public boolean isApplicable( DataElementOperand operand )
+ {
+ return operand.getValueType().equals( VALUE_TYPE_BOOL ) && operand.getAggregationOperator().equals( AGGREGATION_OPERATOR_AVERAGE );
+ }
+
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
private double[] getAggregate( int organisationUnit, Period period, String val, Date startDate, Date endDate, int unitLevel )
{
double value = 0.0;
@@ -181,9 +190,4 @@
return values;
}
-
- public boolean isApplicable( DataElementOperand operand )
- {
- return operand.getValueType().equals( VALUE_TYPE_BOOL ) && operand.getAggregationOperator().equals( AGGREGATION_OPERATOR_AVERAGE );
- }
}
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageIntAggregator.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageIntAggregator.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/AverageIntAggregator.java 2012-08-29 14:44:51 +0000
@@ -146,7 +146,16 @@
return values;
}
+
+ public boolean isApplicable( DataElementOperand operand )
+ {
+ return operand.getValueType().equals( VALUE_TYPE_INT ) && operand.getAggregationOperator().equals( AGGREGATION_OPERATOR_AVERAGE );
+ }
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
private double[] getAggregate( int organisationUnit, Period period, String val, Date startDate, Date endDate, int unitLevel )
{
double value = 0.0;
@@ -187,9 +196,4 @@
return values;
}
-
- public boolean isApplicable( DataElementOperand operand )
- {
- return operand.getValueType().equals( VALUE_TYPE_INT ) && operand.getAggregationOperator().equals( AGGREGATION_OPERATOR_AVERAGE );
- }
}
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumBoolAggregator.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumBoolAggregator.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumBoolAggregator.java 2012-08-29 14:44:51 +0000
@@ -141,8 +141,12 @@
{
return operand.getValueType().equals( VALUE_TYPE_BOOL ) && operand.getAggregationOperator().equals( AGGREGATION_OPERATOR_SUM );
}
-
- public boolean isApplicable( DataElementOperand operand, PeriodType periodType )
+
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
+ private boolean isApplicable( DataElementOperand operand, PeriodType periodType )
{
return operand.getFrequencyOrder() <= periodType.getFrequencyOrder(); // Ignore disaggregation
}
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumIntAggregator.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumIntAggregator.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/aggregation/dataelement/SumIntAggregator.java 2012-08-29 14:44:51 +0000
@@ -142,7 +142,11 @@
return operand.getValueType().equals( VALUE_TYPE_INT ) && operand.getAggregationOperator().equals( AGGREGATION_OPERATOR_SUM );
}
- public boolean isApplicable( DataElementOperand operand, PeriodType periodType )
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
+ private boolean isApplicable( DataElementOperand operand, PeriodType periodType )
{
return operand.getFrequencyOrder() <= periodType.getFrequencyOrder(); // Ignore disaggregation
}
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/dataelement/DefaultDataElementDataMart.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/dataelement/DefaultDataElementDataMart.java 2012-08-29 14:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/dataelement/DefaultDataElementDataMart.java 2012-08-29 14:44:51 +0000
@@ -162,7 +162,11 @@
return null;
}
-
+
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
private Map<DataElementOperand, DataElementAggregator> getAggregatorMap( Collection<DataElementOperand> operands )
{
Map<DataElementOperand, DataElementAggregator> map = new HashMap<DataElementOperand, DataElementAggregator>();
@@ -182,7 +186,7 @@
return map;
}
- public void populateHasAggregationLevels( Collection<DataElementOperand> operands ) //TODO check effect
+ private void populateHasAggregationLevels( Collection<DataElementOperand> operands ) //TODO check effect
{
for ( DataElementOperand operand : operands )
{