tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [2/7] incubator-tinkerpop git commit: TraversalComparator is gutted -- check out that if/else nest that we no longer have to propagate through. Thank the heavens.
Date Thu, 17 Mar 2016 13:17:55 GMT
TraversalComparator is gutted -- check out that if/else nest that we no longer have to propagate
through. Thank the heavens.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/3ee1548a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/3ee1548a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/3ee1548a

Branch: refs/heads/master
Commit: 3ee1548a2b9c0b1c1e00d13a024a388965f5e846
Parents: 813ba24
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Mar 15 10:12:59 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Tue Mar 15 10:12:59 2016 -0600

----------------------------------------------------------------------
 .../step/util/TraversalComparator.java          | 84 --------------------
 1 file changed, 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3ee1548a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TraversalComparator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TraversalComparator.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TraversalComparator.java
deleted file mode 100644
index 24e3829..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TraversalComparator.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class TraversalComparator<S, E> implements Comparator<S>, Serializable,
Cloneable, TraversalParent {
-
-    private Traversal.Admin<S, E> traversal;
-    private final Comparator<E> comparator;
-
-    public TraversalComparator(final Traversal.Admin<S, E> traversal, final Comparator<E>
comparator) {
-        this.traversal = traversal;
-        this.comparator = comparator;
-    }
-
-    public List<Traversal.Admin<S, E>> getLocalChildren() {
-        return Collections.singletonList(this.traversal);
-    }
-
-    @Override
-    public String toString() {
-        return this.comparator.toString() + "(" + this.traversal + ")";
-    }
-
-    @Override
-    public int compare(final S start1, final S start2) {
-        if (start1 instanceof Traverser && start2 instanceof Traverser)
-            return this.comparator.compare(TraversalUtil.apply((Traverser.Admin<S>)
start1, this.traversal), TraversalUtil.apply((Traverser.Admin<S>) start2, this.traversal));
-        else if (start1 instanceof Traverser)
-            return this.comparator.compare(TraversalUtil.apply((Traverser.Admin<S>)
start1, this.traversal), TraversalUtil.apply(start2, this.traversal));
-        else if (start2 instanceof Traverser)
-            return this.comparator.compare(TraversalUtil.apply(start1, this.traversal), TraversalUtil.apply((Traverser.Admin<S>)
start2, this.traversal));
-        else
-            return this.comparator.compare(TraversalUtil.apply(start1, this.traversal), TraversalUtil.apply(start2,
this.traversal));
-    }
-
-    @Override
-    public TraversalComparator clone() {
-        try {
-            final TraversalComparator clone = (TraversalComparator) super.clone();
-            clone.traversal = this.traversal.clone();
-            return clone;
-        } catch (final CloneNotSupportedException e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    public Traversal.Admin<S, E> getTraversal() {
-        return this.traversal;
-    }
-
-    public Comparator<E> getComparator() {
-        return this.comparator;
-    }
-}
-


Mime
View raw message