jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1441967 - in /jena/trunk: jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/ jena-core/src/main/java/com/hp/hpl/jena/graph/compose/ jena-core/src/main/java/com/hp/hpl/jena/graph/impl/
Date Sun, 03 Feb 2013 21:14:52 GMT
Author: andy
Date: Sun Feb  3 21:14:52 2013
New Revision: 1441967

URL: http://svn.apache.org/viewvc?rev=1441967&view=rev
Log:
Put ability to chose PrefixMapping implementation into GraphBase.
Remove GraphBase2.

Removed:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphBase2.java
Modified:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphMemPlain.java
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphUnionRead.java
    jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/compose/Polyadic.java
    jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphBase.java

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphMemPlain.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphMemPlain.java?rev=1441967&r1=1441966&r2=1441967&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphMemPlain.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphMemPlain.java Sun
Feb  3 21:14:52 2013
@@ -25,15 +25,14 @@ import java.util.Set ;
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.graph.Triple ;
 import com.hp.hpl.jena.graph.TripleMatch ;
+import com.hp.hpl.jena.graph.impl.GraphBase ;
 import com.hp.hpl.jena.graph.impl.SimpleEventManager ;
-import com.hp.hpl.jena.shared.PrefixMapping ;
-import com.hp.hpl.jena.shared.impl.PrefixMappingImpl ;
 import com.hp.hpl.jena.util.iterator.ClosableIterator ;
 import com.hp.hpl.jena.util.iterator.ExtendedIterator ;
 import com.hp.hpl.jena.util.iterator.Filter ;
 
 /** A version of Graph that does term equality only */ 
-public class GraphMemPlain extends GraphBase2
+public class GraphMemPlain extends GraphBase
 {
     private Set<Triple> triples = new HashSet<Triple>() ;
     
@@ -48,12 +47,6 @@ public class GraphMemPlain extends Graph
     { triples.remove(t) ; }
     
     @Override
-    protected PrefixMapping createPrefixMapping()
-    {
-        return new PrefixMappingImpl() ;
-    }
-
-    @Override
     public boolean graphBaseContains( Triple t ) 
     {
         if ( t.isConcrete() )

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphUnionRead.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphUnionRead.java?rev=1441967&r1=1441966&r2=1441967&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphUnionRead.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/GraphUnionRead.java Sun
Feb  3 21:14:52 2013
@@ -27,6 +27,7 @@ import com.hp.hpl.jena.graph.Graph ;
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.graph.Triple ;
 import com.hp.hpl.jena.graph.TripleMatch ;
+import com.hp.hpl.jena.graph.impl.GraphBase ;
 import com.hp.hpl.jena.shared.PrefixMapping ;
 import com.hp.hpl.jena.shared.impl.PrefixMappingImpl ;
 import com.hp.hpl.jena.sparql.core.DatasetGraph ;
@@ -34,7 +35,7 @@ import com.hp.hpl.jena.util.iterator.Ext
 import com.hp.hpl.jena.util.iterator.WrappedIterator ;
 
 /** Immutable graph that is the view of a union of graphs in a dataset. */ 
-public class GraphUnionRead extends GraphBase2
+public class GraphUnionRead extends GraphBase
 {
     // This exists for the property path evaulator to have a graph to call.
     private final DatasetGraph dataset ;

Modified: jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/compose/Polyadic.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/compose/Polyadic.java?rev=1441967&r1=1441966&r2=1441967&view=diff
==============================================================================
--- jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/compose/Polyadic.java (original)
+++ jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/compose/Polyadic.java Sun Feb
 3 21:14:52 2013
@@ -23,13 +23,18 @@ package com.hp.hpl.jena.graph.compose;
 
 // Imports
 ///////////////
-import com.hp.hpl.jena.graph.*;
-import com.hp.hpl.jena.graph.impl.WrappedBulkUpdateHandler;
-import com.hp.hpl.jena.shared.*;
-import com.hp.hpl.jena.util.iterator.*;
-
-import java.util.*;
-
+import java.util.ArrayList ;
+import java.util.Iterator ;
+import java.util.List ;
+
+import com.hp.hpl.jena.graph.BulkUpdateHandler ;
+import com.hp.hpl.jena.graph.Capabilities ;
+import com.hp.hpl.jena.graph.Graph ;
+import com.hp.hpl.jena.graph.TransactionHandler ;
+import com.hp.hpl.jena.graph.impl.WrappedBulkUpdateHandler ;
+import com.hp.hpl.jena.shared.JenaException ;
+import com.hp.hpl.jena.shared.PrefixMapping ;
+import com.hp.hpl.jena.util.iterator.ClosableIterator ;
 
 /**
  * <p>
@@ -86,16 +91,12 @@ public abstract class Polyadic extends C
         }
     }
 
-    @SuppressWarnings("hiding")
-    private PrefixMapping pm;
-
     @Override
-    public PrefixMapping getPrefixMapping()
-        {
-        if (pm == null) pm = new PolyadicPrefixMappingImpl( this );
-        return pm;
-        }
-
+    protected PrefixMapping createPrefixMapping()
+    { 
+        return new PolyadicPrefixMappingImpl( this );
+    }
+    
     /**
      * <p>
      * Construct a composition of all of the given graphs.

Modified: jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphBase.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphBase.java?rev=1441967&r1=1441966&r2=1441967&view=diff
==============================================================================
--- jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphBase.java (original)
+++ jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphBase.java Sun Feb 
3 21:14:52 2013
@@ -177,14 +177,18 @@ public abstract class GraphBase implemen
     protected Capabilities capabilities = null;
     
     /**
-         Answer the PrefixMapping object for this graph, the same one each time.
-         Subclasses are unlikely to want to modify this.
-    */
+        Answer the PrefixMapping object for this graph, the same one each time.
+     */
     @Override
     public PrefixMapping getPrefixMapping()
-        { return pm; }
+    { 
+        if ( pm == null )
+            pm = createPrefixMapping() ;
+        return pm;
+    }
 
-    protected PrefixMapping pm = new PrefixMappingImpl();
+    protected PrefixMapping pm = null ;
+    protected PrefixMapping createPrefixMapping() { return new PrefixMappingImpl() ; }
     
 	/**
 	   Add a triple, and notify the event manager. Subclasses should not need to



Mime
View raw message