Skip to content
Snippets Groups Projects
Commit 00e73833 authored by Joseph E. Gonzalez's avatar Joseph E. Gonzalez
Browse files

Fixing a bug in reverse edge direction.

parent 6f82c426
No related branches found
No related tags found
No related merge requests found
......@@ -6,9 +6,13 @@ package org.apache.spark.graph
* the set of adjacent neighbors when running a neighborhood query.
*/
sealed abstract class EdgeDirection {
/**
* Reverse the direction of an edge. An in becomes out,
* out becomes in and both remains both.
*/
def reverse: EdgeDirection = this match {
case EdgeDirection.In => EdgeDirection.In
case EdgeDirection.Out => EdgeDirection.Out
case EdgeDirection.In => EdgeDirection.Out
case EdgeDirection.Out => EdgeDirection.In
case EdgeDirection.Both => EdgeDirection.Both
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment