← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21407: Method re-order

 

------------------------------------------------------------
revno: 21407
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-12-10 12:56:06 +0100
message:
  Method re-order
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.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/expression/ExpressionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2015-12-10 11:41:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2015-12-10 11:56:06 +0000
@@ -188,25 +188,6 @@
     Set<DataElement> getDataElementsInExpression( String expression );
 
     /**
-     * Returns all OrganisationUnitGroups in the numerator and denominator
-     * expressions in the given Indicators. Returns an empty set if the given
-     * indicators are null or empty.
-     * 
-     * @param indicators the set of indicators.
-     * @return a Set of OrganisationUnitGroups.
-     */
-    Set<OrganisationUnitGroup> getOrganisationUnitGroupsInIndicators( Collection<Indicator> indicators );
-    
-    /**
-     * Returns all OrganisationUnitGroups in the given expression string. Returns 
-     * an set list if the given indicators are null or empty.
-     * 
-     * @param expression the expression string.
-     * @return a Set of OrganisationUnitGroups included in the expression string.
-     */
-    Set<OrganisationUnitGroup> getOrganisationUnitGroupsInExpression( String expression );
-    
-    /**
      * Returns all CategoryOptionCombos in the given expression string. Only 
      * operands with a category option combo will be included. Returns an empty
      * set if the given expression is null.
@@ -254,6 +235,25 @@
      * @return a set of data elements.
      */
     Set<DataElement> getDataElementWithOptionCombosInIndicators( Collection<Indicator> indicators );
+
+    /**
+     * Returns all OrganisationUnitGroups in the given expression string. Returns 
+     * an set list if the given indicators are null or empty.
+     * 
+     * @param expression the expression string.
+     * @return a Set of OrganisationUnitGroups included in the expression string.
+     */
+    Set<OrganisationUnitGroup> getOrganisationUnitGroupsInExpression( String expression );
+    
+    /**
+     * Returns all OrganisationUnitGroups in the numerator and denominator
+     * expressions in the given Indicators. Returns an empty set if the given
+     * indicators are null or empty.
+     * 
+     * @param indicators the set of indicators.
+     * @return a Set of OrganisationUnitGroups.
+     */
+    Set<OrganisationUnitGroup> getOrganisationUnitGroupsInIndicators( Collection<Indicator> indicators );
     
     /**
      * Filters indicators from the given collection where the numerator and /

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2015-12-10 11:53:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2015-12-10 11:56:06 +0000
@@ -273,46 +273,6 @@
     }
     
     @Override
-    public Set<OrganisationUnitGroup> getOrganisationUnitGroupsInIndicators( Collection<Indicator> indicators )
-    {
-        Set<OrganisationUnitGroup> groups = new HashSet<>();
-        
-        if ( indicators != null )
-        {   
-            for ( Indicator indicator : indicators )
-            {
-                groups.addAll( getOrganisationUnitGroupsInExpression( indicator.getNumerator() ) );
-                groups.addAll( getOrganisationUnitGroupsInExpression( indicator.getDenominator() ) );
-            }
-        }
-        
-        return groups;
-    }
-    
-    @Override
-    public Set<OrganisationUnitGroup> getOrganisationUnitGroupsInExpression( String expression )
-    {
-        Set<OrganisationUnitGroup> groupsInExpression = new HashSet<>();
-        
-        if ( expression != null )
-        {            
-            final Matcher matcher = OU_GROUP_PATTERN.matcher( expression );
-            
-            while ( matcher.find() )
-            {
-                final OrganisationUnitGroup group = organisationUnitGroupService.getOrganisationUnitGroup( matcher.group( 1 ) );
-                
-                if ( group != null )
-                {
-                    groupsInExpression.add( group );
-                }
-            }
-        }
-        
-        return groupsInExpression;
-    }
-   
-    @Override
     @Transactional
     public Set<DataElementCategoryOptionCombo> getOptionCombosInExpression( String expression )
     {
@@ -407,6 +367,46 @@
     }
 
     @Override
+    public Set<OrganisationUnitGroup> getOrganisationUnitGroupsInExpression( String expression )
+    {
+        Set<OrganisationUnitGroup> groupsInExpression = new HashSet<>();
+        
+        if ( expression != null )
+        {            
+            final Matcher matcher = OU_GROUP_PATTERN.matcher( expression );
+            
+            while ( matcher.find() )
+            {
+                final OrganisationUnitGroup group = organisationUnitGroupService.getOrganisationUnitGroup( matcher.group( 1 ) );
+                
+                if ( group != null )
+                {
+                    groupsInExpression.add( group );
+                }
+            }
+        }
+        
+        return groupsInExpression;
+    }
+    
+    @Override
+    public Set<OrganisationUnitGroup> getOrganisationUnitGroupsInIndicators( Collection<Indicator> indicators )
+    {
+        Set<OrganisationUnitGroup> groups = new HashSet<>();
+        
+        if ( indicators != null )
+        {   
+            for ( Indicator indicator : indicators )
+            {
+                groups.addAll( getOrganisationUnitGroupsInExpression( indicator.getNumerator() ) );
+                groups.addAll( getOrganisationUnitGroupsInExpression( indicator.getDenominator() ) );
+            }
+        }
+        
+        return groups;
+    }
+    
+    @Override
     @Transactional
     public void filterInvalidIndicators( List<Indicator> indicators )
     {