jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1174723 - in /incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql: engine/iterator/ expr/aggregate/
Date Fri, 23 Sep 2011 13:01:32 GMT
Author: andy
Date: Fri Sep 23 13:01:31 2011
New Revision: 1174723

URL: http://svn.apache.org/viewvc?rev=1174723&view=rev
Log:
Clear-up Aggregator interface (post JENA-120)

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterGroup.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvg.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvgDistinct.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCount.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountDistinct.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVar.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVarDistinct.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMaxBase.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMinBase.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggNull.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSample.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSampleDistinct.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSumDistinct.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/Aggregator.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterGroup.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterGroup.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterGroup.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterGroup.java
Fri Sep 23 13:01:31 2011
@@ -88,7 +88,7 @@ public class QueryIterGroup extends Quer
                     {
                         for ( ExprAggregator agg : aggregators )
                         {
-                            Accumulator x = agg.getAggregator().createAcc() ;
+                            Accumulator x = agg.getAggregator().createAccumulator() ;
                             Var v = agg.getVar() ;
                             accumulators.put(key, Pair.create(v, x)) ;
                         }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvg.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvg.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvg.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvg.java Fri
Sep 23 13:01:31 2011
@@ -36,7 +36,7 @@ public class AggAvg extends AggregatorBa
     public String toPrefixString() { return "(avg "+WriterExpr.asString(expr)+")" ; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccAvg(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvgDistinct.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvgDistinct.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvgDistinct.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggAvgDistinct.java
Fri Sep 23 13:01:31 2011
@@ -34,7 +34,7 @@ public class AggAvgDistinct extends Aggr
     public String toPrefixString() { return "(avg distinct "+WriterExpr.asString(expr)+")"
; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccAvgDistinct(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCount.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCount.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCount.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCount.java
Fri Sep 23 13:01:31 2011
@@ -31,7 +31,7 @@ public class AggCount extends Aggregator
     public Expr getExpr()       { return null ; }
     
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AggCount.AccCount();
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountDistinct.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountDistinct.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountDistinct.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountDistinct.java
Fri Sep 23 13:01:31 2011
@@ -36,7 +36,7 @@ public class AggCountDistinct extends Ag
     public Expr getExpr()           { return null ; }
     
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccCountDistinct() ; 
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVar.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVar.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVar.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVar.java
Fri Sep 23 13:01:31 2011
@@ -29,7 +29,7 @@ public class AggCountVar extends Aggrega
     public String toPrefixString() { return "(count "+expr+")" ; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccCountVar(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVarDistinct.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVarDistinct.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVarDistinct.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggCountVarDistinct.java
Fri Sep 23 13:01:31 2011
@@ -29,7 +29,7 @@ public class AggCountVarDistinct extends
     public String toPrefixString()  { return "(count distinct "+expr+")" ; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccCountVarDistinct() ; 
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
Fri Sep 23 13:01:31 2011
@@ -73,7 +73,7 @@ public class AggGroupConcat extends Aggr
     }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccGroupConcat(expr, separator) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
Fri Sep 23 13:01:31 2011
@@ -71,7 +71,7 @@ public class AggGroupConcatDistinct exte
     }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccGroupConcatDistinct(expr, separator) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMaxBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMaxBase.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMaxBase.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMaxBase.java
Fri Sep 23 13:01:31 2011
@@ -22,7 +22,8 @@ abstract class AggMaxBase extends Aggreg
     public AggMaxBase(Expr expr) { this.expr = expr ; } 
 
     @Override
-    protected final Accumulator createAccumulator()
+    public
+    final Accumulator createAccumulator()
     { 
         return new AccMax(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMinBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMinBase.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMinBase.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggMinBase.java
Fri Sep 23 13:01:31 2011
@@ -22,7 +22,8 @@ abstract class AggMinBase extends Aggreg
     public AggMinBase(Expr expr) { this.expr = expr ; } 
 
     @Override
-    protected final Accumulator createAccumulator()
+    public
+    final Accumulator createAccumulator()
     { 
         return new AccMin(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggNull.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggNull.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggNull.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggNull.java
Fri Sep 23 13:01:31 2011
@@ -26,7 +26,7 @@ public class AggNull extends AggregatorB
     public String toPrefixString() { return "(aggnull)" ; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return createAccNull() ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSample.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSample.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSample.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSample.java
Fri Sep 23 13:01:31 2011
@@ -29,7 +29,7 @@ public class AggSample extends Aggregato
     public String toPrefixString() { return "(sample "+WriterExpr.asString(expr)+")" ; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccSample(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSampleDistinct.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSampleDistinct.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSampleDistinct.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSampleDistinct.java
Fri Sep 23 13:01:31 2011
@@ -29,7 +29,7 @@ public class AggSampleDistinct extends A
     public String toPrefixString() { return "(sample distinct"+WriterExpr.asString(expr)+")"
; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccSampleDistict(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java Fri
Sep 23 13:01:31 2011
@@ -33,7 +33,7 @@ public class AggSum  extends AggregatorB
     public String toPrefixString() { return "(sum "+WriterExpr.asString(expr)+")" ; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccSum(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSumDistinct.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSumDistinct.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSumDistinct.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggSumDistinct.java
Fri Sep 23 13:01:31 2011
@@ -34,7 +34,7 @@ public class AggSumDistinct  extends Agg
     public String toPrefixString() { return "(sum distinct "+WriterExpr.asString(expr)+")"
; }
 
     @Override
-    protected Accumulator createAccumulator()
+    public Accumulator createAccumulator()
     { 
         return new AccSumDistinct(expr) ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/Aggregator.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/Aggregator.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/Aggregator.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/Aggregator.java
Fri Sep 23 13:01:31 2011
@@ -9,9 +9,7 @@
 package com.hp.hpl.jena.sparql.expr.aggregate;
 
 import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
 import com.hp.hpl.jena.sparql.expr.Expr ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
 import com.hp.hpl.jena.sparql.graph.NodeTransform ;
 
 /** An Aggregator is the processor for the whole result stream.
@@ -19,25 +17,15 @@ import com.hp.hpl.jena.sparql.graph.Node
 
 public interface Aggregator
 {
-    // Rename as createAccumulator
-    public Accumulator createAcc() ;
-    
-    
     //-- Aggregator - per query (strictly, one per SELECT level), unique even if mentioned
several times.
     //-- Accumulator - per group per key section processors (from AggregatorBase)
 
-    // Remove 
-    public void accumulate(Binding key, Binding b, FunctionEnv functionEnv) ;
-    
-    // Push to Accumulator
+    /** Create an accumulator for this aggregator */ 
+    public Accumulator createAccumulator() ;
     
-    public Node getValue(Binding key) ;
     /** Value if there are no elements in any group : return null for no result */
     public Node getValueEmpty() ;
     
-    
-    
-    
     public String toPrefixString()  ;
     // Key to identify an aggregator as syntax for duplicate use in a query.
     public String key() ;           

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java?rev=1174723&r1=1174722&r2=1174723&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java
Fri Sep 23 13:01:31 2011
@@ -15,7 +15,6 @@ import com.hp.hpl.jena.sparql.ARQInterna
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
 import com.hp.hpl.jena.sparql.expr.Expr ;
 import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
 import com.hp.hpl.jena.sparql.graph.NodeTransform ;
 
 /** Aggregate that does everything except the per-group aggregation that is needed for each
operation */  
@@ -37,21 +36,7 @@ public abstract class AggregatorBase imp
     
     private Map<Binding, Accumulator> buckets = new HashMap<Binding, Accumulator>()
;   // Bindingkey => Accumulator
 
-    final
-    public void accumulate(Binding key, Binding binding, FunctionEnv functionEnv)
-    {
-        Accumulator acc = buckets.get(key) ;
-        if ( acc == null )
-        {
-            acc = createAccumulator() ;
-            buckets.put(key, acc) ;
-        }
-        acc.accumulate(binding, functionEnv) ;
-    }
-
-    // Temporary for development.
-    public Accumulator createAcc() { return createAccumulator() ; }
-    protected abstract Accumulator createAccumulator() ;
+    public abstract Accumulator createAccumulator() ;
     
     public abstract Node getValueEmpty() ;
 



Mime
View raw message