jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1155409 - /incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingOutputStream.java
Date Tue, 09 Aug 2011 15:48:38 GMT
Author: andy
Date: Tue Aug  9 15:48:38 2011
New Revision: 1155409

URL: http://svn.apache.org/viewvc?rev=1155409&view=rev
Log:
JENA-85
Implement interface Sink<Binding>

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingOutputStream.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingOutputStream.java?rev=1155409&r1=1155408&r2=1155409&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingOutputStream.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingOutputStream.java
Tue Aug  9 15:48:38 2011
@@ -25,6 +25,7 @@ import java.util.Map ;
 
 import org.openjena.atlas.io.BufferingWriter ;
 import org.openjena.atlas.iterator.Iter ;
+import org.openjena.atlas.lib.Sink ;
 import org.openjena.riot.RiotException ;
 import org.openjena.riot.system.PrefixMap ;
 
@@ -34,7 +35,7 @@ import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.util.FmtUtils ;
 
 /** Parser for the RDF Tuples language */
-public class BindingOutputStream 
+public class BindingOutputStream implements Sink<Binding>
 {
     private final BufferingWriter bw ;
     private Binding lastBinding = null ;
@@ -66,7 +67,8 @@ public class BindingOutputStream 
         needOutputVars = (vars != null ) && vars.size() > 0 ;
     }
     
-    public void output(Binding binding)
+    public final void write(Binding binding) { send(binding) ; }
+    public void send(Binding binding)
     {
         try {
             if ( needOutputPMap )
@@ -158,6 +160,11 @@ public class BindingOutputStream 
     {
         bw.flush() ;
     }
+    
+    public void close()
+    {
+        bw.close() ;
+    }
 
     public List<Var> getVars()
     {



Mime
View raw message