You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/11/04 13:51:44 UTC
[02/10] incubator-tinkerpop git commit: modified method/type
signature of SumGlobalStep after getting some feedback from @okram
modified method/type signature of SumGlobalStep after getting some feedback from @okram
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/eda16b50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/eda16b50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/eda16b50
Branch: refs/heads/TINKERPOP3-904
Commit: eda16b504fda57f58d8d90a60421bde386528bba
Parents: d49deaf
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat Oct 31 18:42:09 2015 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat Oct 31 18:42:09 2015 +0100
----------------------------------------------------------------------
.../gremlin/process/traversal/step/map/SumGlobalStep.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/eda16b50/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
index 8816390..14573d1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
@@ -43,7 +43,7 @@ import static org.apache.tinkerpop.gremlin.process.traversal.NumberHelper.mul;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public final class SumGlobalStep extends ReducingBarrierStep<Number, Number> implements MapReducer {
+public final class SumGlobalStep<S extends Number> extends ReducingBarrierStep<S, S> implements MapReducer {
private static final Set<TraverserRequirement> REQUIREMENTS = EnumSet.of(
TraverserRequirement.BULK,
@@ -52,7 +52,7 @@ public final class SumGlobalStep extends ReducingBarrierStep<Number, Number> imp
public SumGlobalStep(final Traversal.Admin traversal) {
super(traversal);
- this.setSeedSupplier(new ConstantSupplier<>(0));
+ this.setSeedSupplier(new ConstantSupplier<>((S) Integer.valueOf(0)));
this.setBiFunction(SumGlobalBiFunction.instance());
}
@@ -69,7 +69,7 @@ public final class SumGlobalStep extends ReducingBarrierStep<Number, Number> imp
/////
- private static class SumGlobalBiFunction<S extends Number> implements BiFunction<Number, Traverser<S>, Number>, Serializable {
+ private static class SumGlobalBiFunction<S extends Number> implements BiFunction<S, Traverser<S>, S>, Serializable {
private static final SumGlobalBiFunction INSTANCE = new SumGlobalBiFunction<>();
@@ -78,8 +78,8 @@ public final class SumGlobalStep extends ReducingBarrierStep<Number, Number> imp
}
@Override
- public Number apply(final Number mutatingSeed, final Traverser<S> traverser) {
- return add(mutatingSeed, mul(traverser.get(), traverser.bulk()));
+ public S apply(final S mutatingSeed, final Traverser<S> traverser) {
+ return (S) add(mutatingSeed, mul(traverser.get(), traverser.bulk()));
}
public static <S extends Number> SumGlobalBiFunction<S> instance() {