jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cla...@apache.org
Subject [12/50] [abbrv] jena git commit: JENA-929: Migrate Filter to Java 8 Predicate
Date Sun, 10 May 2015 13:03:41 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredResIterator.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredResIterator.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredResIterator.java
index 4baa134..86599e0 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredResIterator.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredResIterator.java
@@ -21,13 +21,13 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.function.Function;
+import java.util.function.Predicate;
 
 import org.apache.jena.permissions.model.SecuredModel;
 import org.apache.jena.permissions.model.SecuredResource;
 import org.apache.jena.rdf.model.ResIterator ;
 import org.apache.jena.rdf.model.Resource ;
 import org.apache.jena.util.iterator.ExtendedIterator ;
-import org.apache.jena.util.iterator.Filter ;
 
 public class SecuredResIterator implements ResIterator
 {
@@ -72,13 +72,13 @@ public class SecuredResIterator implements ResIterator
 	}
 
 	@Override
-	public ExtendedIterator<Resource> filterDrop( final Filter<Resource> f )
+	public ExtendedIterator<Resource> filterDrop( final Predicate<Resource> f )
 	{
 		return iter.filterDrop(f);
 	}
 
 	@Override
-	public ExtendedIterator<Resource> filterKeep( final Filter<Resource> f )
+	public ExtendedIterator<Resource> filterKeep( final Predicate<Resource> f )
 	{
 		return iter.filterKeep(f);
 	}

http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredSeqImpl.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredSeqImpl.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredSeqImpl.java
index c85ea19..d2515b8 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredSeqImpl.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredSeqImpl.java
@@ -17,13 +17,14 @@
  */
 package org.apache.jena.permissions.model.impl;
 
+import java.util.function.Predicate;
+
 import org.apache.jena.graph.Triple ;
 import org.apache.jena.permissions.impl.ItemHolder;
 import org.apache.jena.permissions.impl.SecuredItemInvoker;
 import org.apache.jena.permissions.model.*;
 import org.apache.jena.rdf.model.* ;
 import org.apache.jena.util.iterator.ExtendedIterator ;
-import org.apache.jena.util.iterator.Filter ;
 import org.apache.jena.vocabulary.RDF ;
 
 /**
@@ -35,7 +36,7 @@ import org.apache.jena.vocabulary.RDF ;
  */
 public class SecuredSeqImpl extends SecuredContainerImpl implements SecuredSeq
 {
-	private class RDFNodeFilter extends Filter<Statement>
+	private class RDFNodeFilter implements Predicate<Statement>
 	{
 		private final RDFNode n;
 
@@ -45,7 +46,7 @@ public class SecuredSeqImpl extends SecuredContainerImpl implements SecuredSeq
 		}
 
 		@Override
-		public boolean accept( final Statement o )
+		public boolean test( final Statement o )
 		{
 			return (o.getPredicate().getOrdinal() != 0)
 					&& n.equals(o.getObject());

http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredStatementIterator.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredStatementIterator.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredStatementIterator.java
index 81df811..29a54c4 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredStatementIterator.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredStatementIterator.java
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.function.Function;
+import java.util.function.Predicate;
 
 import org.apache.jena.permissions.SecurityEvaluator.Action;
 import org.apache.jena.permissions.model.SecuredModel;
@@ -30,7 +31,6 @@ import org.apache.jena.permissions.utils.PermStatementFilter;
 import org.apache.jena.rdf.model.Statement ;
 import org.apache.jena.rdf.model.StmtIterator ;
 import org.apache.jena.util.iterator.ExtendedIterator ;
-import org.apache.jena.util.iterator.Filter ;
 
 /**
  * A secured StatementIterator implementation
@@ -87,13 +87,13 @@ public class SecuredStatementIterator implements StmtIterator
 	}
 
 	@Override
-	public ExtendedIterator<Statement> filterDrop( final Filter<Statement> f )
+	public ExtendedIterator<Statement> filterDrop( final Predicate<Statement> f
)
 	{
 		return iter.filterDrop(f);
 	}
 
 	@Override
-	public ExtendedIterator<Statement> filterKeep( final Filter<Statement> f )
+	public ExtendedIterator<Statement> filterKeep( final Predicate<Statement> f
)
 	{
 		return iter.filterKeep(f);
 	}

http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/utils/ContainerFilter.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/ContainerFilter.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/ContainerFilter.java
index f9ae910..7b6e74f 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/ContainerFilter.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/ContainerFilter.java
@@ -17,16 +17,17 @@
  */
 package org.apache.jena.permissions.utils;
 
+import java.util.function.Predicate;
+
 import org.apache.jena.rdf.model.Property ;
 import org.apache.jena.rdf.model.Statement ;
-import org.apache.jena.util.iterator.Filter ;
 import org.apache.jena.vocabulary.RDF ;
 
-public class ContainerFilter extends Filter<Statement>
+public class ContainerFilter implements Predicate<Statement>
 {
 
 	@Override
-	public boolean accept( final Statement o )
+	public boolean test( final Statement o )
 	{
 		final Property p = o.getPredicate();
 		if (p.getNameSpace().equals(RDF.getURI())

http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermStatementFilter.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermStatementFilter.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermStatementFilter.java
index b8549bb..ba03fd8 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermStatementFilter.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermStatementFilter.java
@@ -19,6 +19,7 @@ package org.apache.jena.permissions.utils;
 
 import java.util.Collection;
 import java.util.Set;
+import java.util.function.Predicate;
 
 import org.apache.jena.permissions.SecurityEvaluator;
 import org.apache.jena.permissions.SecurityEvaluator.Action;
@@ -26,14 +27,13 @@ import org.apache.jena.permissions.SecurityEvaluator.SecNode;
 import org.apache.jena.permissions.impl.SecuredItem;
 import org.apache.jena.permissions.impl.SecuredItemImpl;
 import org.apache.jena.rdf.model.Statement ;
-import org.apache.jena.util.iterator.Filter ;
 
 /**
  * A filter for to filter ExtendedIterators on Statements.
  * This filter removes any triple that the user can not perform all
  * the actions on.
  */
-public class PermStatementFilter extends Filter<Statement>
+public class PermStatementFilter implements Predicate<Statement>
 {
 	private final SecurityEvaluator evaluator;
 	private final SecNode modelNode;
@@ -155,7 +155,7 @@ public class PermStatementFilter extends Filter<Statement>
 	}
 
 	@Override
-	public boolean accept( final Statement s )
+	public boolean test( final Statement s )
 	{
 		return evaluator.evaluateAny(principal, actions, modelNode,
 				SecuredItemImpl.convert(s.asTriple()));

http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermTripleFilter.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermTripleFilter.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermTripleFilter.java
index a96a2cc..5f54814 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermTripleFilter.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/PermTripleFilter.java
@@ -19,6 +19,7 @@ package org.apache.jena.permissions.utils;
 
 import java.util.Collection;
 import java.util.Set;
+import java.util.function.Predicate;
 
 import org.apache.jena.graph.Triple ;
 import org.apache.jena.permissions.SecurityEvaluator;
@@ -26,14 +27,13 @@ import org.apache.jena.permissions.SecurityEvaluator.Action;
 import org.apache.jena.permissions.SecurityEvaluator.SecNode;
 import org.apache.jena.permissions.impl.SecuredItem;
 import org.apache.jena.permissions.impl.SecuredItemImpl;
-import org.apache.jena.util.iterator.Filter ;
 
 /**
  * A filter for to filter ExtendedIterators on Triples.
  * This filter removes any triple that the user can not perform all
  * the actions on.
  */
-public class PermTripleFilter extends Filter<Triple>
+public class PermTripleFilter implements Predicate<Triple>
 {
 	private final SecurityEvaluator evaluator;
 	private final SecNode modelNode;
@@ -154,7 +154,7 @@ public class PermTripleFilter extends Filter<Triple>
 	}
 
 	@Override
-	public boolean accept( final Triple t )
+	public boolean test( final Triple t )
 	{
 		return evaluator.evaluateAny(principal, actions, modelNode,
 				SecuredItemImpl.convert(t));

http://git-wip-us.apache.org/repos/asf/jena/blob/c3346910/jena-permissions/src/main/java/org/apache/jena/permissions/utils/RDFListSecFilter.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/RDFListSecFilter.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/RDFListSecFilter.java
index efa87a1..7d08a21 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/utils/RDFListSecFilter.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/utils/RDFListSecFilter.java
@@ -18,6 +18,7 @@
 package org.apache.jena.permissions.utils;
 
 import java.util.Set;
+import java.util.function.Predicate;
 
 import org.apache.jena.permissions.SecurityEvaluator;
 import org.apache.jena.permissions.SecurityEvaluator.Action;
@@ -25,10 +26,9 @@ import org.apache.jena.permissions.impl.SecuredItem;
 import org.apache.jena.permissions.impl.SecuredItemImpl;
 import org.apache.jena.rdf.model.RDFList ;
 import org.apache.jena.rdf.model.Statement ;
-import org.apache.jena.util.iterator.Filter ;
 import org.apache.jena.vocabulary.RDF ;
 
-public class RDFListSecFilter<T extends RDFList> extends Filter<T>
+public class RDFListSecFilter<T extends RDFList> implements Predicate<T>
 {
 	private final SecuredItem securedItem;
 	private final Set<Action> perms;
@@ -48,7 +48,7 @@ public class RDFListSecFilter<T extends RDFList> extends Filter<T>
 	}
 
 	@Override
-	public boolean accept( final RDFList o )
+	public boolean test( final RDFList o )
 	{
 		final Statement s = o.getRequiredProperty(RDF.first);
 		return securedItem.getSecurityEvaluator().evaluate(principal, perms,


Mime
View raw message