forked from CIDARLAB/knox
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functionality: reverse the edges from the input design space. Details: Upon selecting reverse operator a. Delete input option b. Display some guidance Close CIDARLAB#14
- Loading branch information
1 parent
bc4f342
commit 0e3ca78
Showing
6 changed files
with
113 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/knox/spring/data/neo4j/operations/ReverseOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package knox.spring.data.neo4j.operations; | ||
|
||
import knox.spring.data.neo4j.domain.Edge; | ||
import knox.spring.data.neo4j.domain.NodeSpace; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class ReverseOperator { | ||
public static void apply(NodeSpace inputSpace, NodeSpace outputSpace) { | ||
//copy input space to a new output space | ||
outputSpace.copyNodeSpace(inputSpace); | ||
|
||
Set<Edge> allEdges = outputSpace.getEdges(); | ||
|
||
//traverse all edges of input space and flip the orientation attribute | ||
for(Edge edge: allEdges){ | ||
edge.reverseOrientation(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters