jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1363537 - in /jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate: AggGroupConcat.java AggGroupConcatDistinct.java
Date Thu, 19 Jul 2012 20:51:37 GMT
Author: andy
Date: Thu Jul 19 20:51:37 2012
New Revision: 1363537

URL: http://svn.apache.org/viewvc?rev=1363537&view=rev
Log:
public getSeparator()

Modified:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java?rev=1363537&r1=1363536&r2=1363537&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcat.java
Thu Jul 19 20:51:37 2012
@@ -34,36 +34,33 @@ public class AggGroupConcat extends Aggr
 {
     static final String SeparatorDefault = " " ;
     private final Expr expr ;
-    private final String separatorSeen ;
     private final String separator ;
+    private final String effectiveSeparator ;
 
     public AggGroupConcat(Expr expr, String separator)
     {
         this(expr, 
              ( separator != null ) ? separator : SeparatorDefault ,
              separator) ;
-//        this.expr = expr ; 
-//        separatorSeen = separator ;
-//        this.separator = ( separator != null ) ? separator : SeparatorDefault ; 
     } 
     
-    private AggGroupConcat(Expr expr, String separator, String separatorSeen)
+    private AggGroupConcat(Expr expr, String effectiveSeparator, String separatorSeen)
     {
         this.expr = expr ; 
-        this.separatorSeen = separatorSeen ;
-        this.separator = separator ; 
+        this.separator = separatorSeen ;
+        this.effectiveSeparator = effectiveSeparator ; 
     }
     
     @Override
-    public Aggregator copy(Expr expr) { return new AggGroupConcat(expr, separator, separatorSeen)
; }
+    public Aggregator copy(Expr expr) { return new AggGroupConcat(expr, effectiveSeparator,
separator) ; }
 
     @Override
     public String toString()
     {
         String x = "GROUP_CONCAT("+ExprUtils.fmtSPARQL(expr) ;
-        if ( separatorSeen != null )
+        if ( separator != null )
         {
-            String y = StrUtils.escapeString(separatorSeen) ;
+            String y = StrUtils.escapeString(separator) ;
             x = x+"; SEPARATOR='"+y+"'" ;
         }
         x = x+")" ;
@@ -75,9 +72,9 @@ public class AggGroupConcat extends Aggr
     {
         String x = "(group_concat " ;
         
-        if ( separatorSeen != null )
+        if ( separator != null )
         {
-            String y = StrUtils.escapeString(separatorSeen) ;
+            String y = StrUtils.escapeString(separator) ;
             x = x+"(separator '"+y+"') " ;
         }
         x = x+WriterExpr.asString(expr)+")" ;
@@ -87,12 +84,13 @@ public class AggGroupConcat extends Aggr
     @Override
     public Accumulator createAccumulator()
     { 
-        return new AccGroupConcat(expr, separator) ;
+        return new AccGroupConcat(expr, effectiveSeparator) ;
     }
 
     @Override
     public Expr getExpr() { return expr ; }
-    protected final String getSeparator() { return separator ; }
+    
+    public String getSeparator() { return separator ; }
 
     @Override
     public Node getValueEmpty() { return NodeConst.emptyString ; } 

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java?rev=1363537&r1=1363536&r2=1363537&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggGroupConcatDistinct.java
Thu Jul 19 20:51:37 2012
@@ -32,36 +32,33 @@ import com.hp.hpl.jena.sparql.util.ExprU
 public class AggGroupConcatDistinct extends AggregatorBase
 {
     private final Expr expr ;
-    private final String separatorSeen ;
     private final String separator ;
+    private final String effectiveSeparator ;
 
     public AggGroupConcatDistinct(Expr expr, String separator)
     { 
         this(expr, 
              ( separator != null ) ? separator : AggGroupConcat.SeparatorDefault ,
              separator) ;
-//        this.expr = expr ; 
-//        this.separatorSeen = separator ;
-//        this.separator =  ( separator != null ) ? separator : AggGroupConcat.SeparatorDefault
; 
     }
 
-    private AggGroupConcatDistinct(Expr expr, String separator, String separatorSeen)
+    private AggGroupConcatDistinct(Expr expr, String effectiveSeparator, String separatorSeen)
     {
         this.expr = expr ; 
-        this.separatorSeen = separatorSeen ;
-        this.separator = separator ; 
+        this.separator = separatorSeen ;
+        this.effectiveSeparator = effectiveSeparator ; 
     }
     
     @Override
-    public Aggregator copy(Expr expr) { return new AggGroupConcatDistinct(expr, separator,
separatorSeen) ; }
+    public Aggregator copy(Expr expr) { return new AggGroupConcatDistinct(expr, effectiveSeparator,
separator) ; }
 
     @Override
     public String toString()
     {
         String x = "GROUP_CONCAT(DISTINCT "+ExprUtils.fmtSPARQL(expr) ;
-        if ( separatorSeen != null )
+        if ( separator != null )
         {
-            String y = StrUtils.escapeString(separatorSeen) ;
+            String y = StrUtils.escapeString(separator) ;
             x = x+"; SEPARATOR='"+y+"'" ;
         }
         x = x+")" ;
@@ -73,9 +70,9 @@ public class AggGroupConcatDistinct exte
     {
         String x = "(group_concat distinct " ;
         
-        if ( separatorSeen != null )
+        if ( separator != null )
         {
-            String y = StrUtils.escapeString(separatorSeen) ;
+            String y = StrUtils.escapeString(separator) ;
             x = x+"(separator '"+y+"') " ;
         }
         x = x+WriterExpr.asString(expr)+")" ;
@@ -85,12 +82,13 @@ public class AggGroupConcatDistinct exte
     @Override
     public Accumulator createAccumulator()
     { 
-        return new AccGroupConcatDistinct(expr, separator) ;
+        return new AccGroupConcatDistinct(expr, effectiveSeparator) ;
     }
 
     @Override
     public Expr getExpr() { return expr ; }
-    protected final String getSeparator() { return separator ; }
+    
+    public String getSeparator() { return separator ; }
 
     @Override
     public Node getValueEmpty()     { return null ; } 



Mime
View raw message