sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1676788 - in /sis/branches/JDK8/core/sis-feature/src: main/java/org/apache/sis/feature/AbstractOperation.java main/java/org/apache/sis/feature/DefaultOperation.java test/java/org/apache/sis/feature/NoOperation.java
Date Wed, 29 Apr 2015 16:40:56 GMT
Author: desruisseaux
Date: Wed Apr 29 16:40:56 2015
New Revision: 1676788

URL: http://svn.apache.org/r1676788
Log:
Feature: renamed AbstractOperation.invoke(...) as apply(...) for compatibility with JDK8 BiFunction
interface.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/NoOperation.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java?rev=1676788&r1=1676787&r2=1676788&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
[UTF-8] Wed Apr 29 16:40:56 2015
@@ -27,6 +27,7 @@ import org.apache.sis.util.Debug;
 
 // Branch-dependent imports
 import java.util.Objects;
+import java.util.function.BiFunction;
 import org.opengis.feature.Feature;
 import org.opengis.feature.IdentifiedType;
 import org.opengis.feature.Operation;
@@ -53,7 +54,9 @@ import org.opengis.feature.Property;
  * @version 0.6
  * @module
  */
-public abstract class AbstractOperation extends AbstractIdentifiedType implements Operation
{
+public abstract class AbstractOperation extends AbstractIdentifiedType implements Operation,
+        BiFunction<Feature, ParameterValueGroup, Property>
+{
     /**
      * For cross-version compatibility.
      */
@@ -123,14 +126,15 @@ public abstract class AbstractOperation
      *
      * <div class="note"><b>Analogy:</b>
      * if we compare {@code Operation} to {@link Method} in the Java language, then this
method is equivalent
-     * to {@link Method#invoke(Object, Object...)}. The {@code Feature} argument is equivalent
to {@code this}
+     * to {@link Method#apply(Object, Object...)}. The {@code Feature} argument is equivalent
to {@code this}
      * in the Java language.</div>
      *
      * @param  feature    The feature on which to execute the operation.
      * @param  parameters The parameters to use for executing the operation.
      * @return The operation result, or {@code null} if this operation does not produce any
result.
      */
-    public abstract Property invoke(Feature feature, ParameterValueGroup parameters);
+    @Override
+    public abstract Property apply(Feature feature, ParameterValueGroup parameters);
 
     /**
      * Returns a hash code value for this operation.

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java?rev=1676788&r1=1676787&r2=1676788&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
[UTF-8] Wed Apr 29 16:40:56 2015
@@ -62,7 +62,7 @@ public class DefaultOperation extends Ab
      * @return {@inheritDoc}
      */
     @Override
-    public Property invoke(Feature feature, ParameterValueGroup parameters) {
+    public Property apply(Feature feature, ParameterValueGroup parameters) {
         throw new UnsupportedOperationException();
     }
 }

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/NoOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/NoOperation.java?rev=1676788&r1=1676787&r2=1676788&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/NoOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/NoOperation.java
[UTF-8] Wed Apr 29 16:40:56 2015
@@ -57,7 +57,7 @@ final strictfp class NoOperation extends
      * @return {@code null}
      */
     @Override
-    public Property invoke(Feature feature, ParameterValueGroup parameters) {
+    public Property apply(Feature feature, ParameterValueGroup parameters) {
         return null;
     }
 }



Mime
View raw message