You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2016/07/09 09:39:02 UTC
[06/18] jena git commit: Reformat.
Reformat.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/ba00301f
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/ba00301f
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/ba00301f
Branch: refs/heads/master
Commit: ba00301f644d15783dd7fa39a6751c58e9603502
Parents: 193b144
Author: Andy Seaborne <an...@apache.org>
Authored: Thu Jul 7 21:48:07 2016 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Thu Jul 7 21:48:07 2016 +0100
----------------------------------------------------------------------
.../org/apache/jena/sparql/graph/GraphOps.java | 43 ++++++++------------
1 file changed, 16 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/ba00301f/jena-arq/src/main/java/org/apache/jena/sparql/graph/GraphOps.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/graph/GraphOps.java b/jena-arq/src/main/java/org/apache/jena/sparql/graph/GraphOps.java
index 6d52bdc..3911236 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/graph/GraphOps.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/graph/GraphOps.java
@@ -29,60 +29,49 @@ import org.apache.jena.sparql.core.DatasetGraph ;
import org.apache.jena.sparql.core.Quad ;
// Combine with Jena GraphUtils.
-public class GraphOps
-{
-
- public static boolean containsGraph(DatasetGraph dsg, Node gn)
- {
- // [[DynDS]]
- if ( Quad.isDefaultGraph(gn))
+public class GraphOps {
+ public static boolean containsGraph(DatasetGraph dsg, Node gn) {
+ if ( Quad.isDefaultGraph(gn) )
return true ;
- if ( Quad.isUnionGraph(gn))
+ if ( Quad.isUnionGraph(gn) )
return true ;
return dsg.containsGraph(gn) ;
}
-
- public static Graph getGraph(DatasetGraph dsg, Node gn)
- {
- // [[DynDS]]
+
+ public static Graph getGraph(DatasetGraph dsg, Node gn) {
if ( gn == null )
return dsg.getDefaultGraph() ;
if ( Quad.isDefaultGraph(gn) )
// Explicit or generated.
return dsg.getDefaultGraph() ;
- if ( Quad.isUnionGraph(gn))
+ if ( Quad.isUnionGraph(gn) )
return unionGraph(dsg) ;
return dsg.getGraph(gn) ;
}
-
- public static Graph unionGraph(DatasetGraph dsg)
- {
+
+ public static Graph unionGraph(DatasetGraph dsg) {
+ // Snapshot it now.
List<Node> x = Iter.toList(dsg.listGraphNodes()) ;
return new GraphUnionRead(dsg, x) ;
}
- public static void addAll(Graph g, Iterator<Triple> iter)
- {
- while(iter.hasNext())
+ public static void addAll(Graph g, Iterator<Triple> iter) {
+ while (iter.hasNext())
g.add(iter.next()) ;
Iter.close(iter) ;
}
- public static void addAll(Graph g, Iterable<Triple> iter)
- {
+ public static void addAll(Graph g, Iterable<Triple> iter) {
addAll(g, iter.iterator()) ;
}
- public static void deleteAll(Graph g, Iterator<Triple> iter)
- {
- while(iter.hasNext())
+ public static void deleteAll(Graph g, Iterator<Triple> iter) {
+ while (iter.hasNext())
g.delete(iter.next()) ;
Iter.close(iter) ;
}
- public static void deleteAll(Graph g, Iterable<Triple> iter)
- {
+ public static void deleteAll(Graph g, Iterable<Triple> iter) {
deleteAll(g, iter.iterator()) ;
}
-
}