diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-10 18:17:06 +0100 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-11 12:34:47 +0100 |
| commit | 17bd9beaf7f358a44e5bf36a5855fe6727d506dc (patch) | |
| tree | 47e9310a0cff869d9ec017dcb2c81876407782c8 /src/uk/ac/ox/cs/pagoda/summary/Edge.java | |
| parent | 8651164cd632a5db310b457ce32d4fbc97bdc41c (diff) | |
| download | ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.tar.gz ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.zip | |
[pagoda] Move project to Scala
This commit includes a few changes:
- The repository still uses Maven to manage dependency but it is now a
Scala project.
- The code has been ported from OWLAPI 3.4.10 to 5.1.20
- A proof of concept program using both RSAComb and PAGOdA has been
added.
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/summary/Edge.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/summary/Edge.java | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/summary/Edge.java b/src/uk/ac/ox/cs/pagoda/summary/Edge.java deleted file mode 100644 index 79d3041..0000000 --- a/src/uk/ac/ox/cs/pagoda/summary/Edge.java +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.summary; | ||
| 2 | |||
| 3 | import java.util.Comparator; | ||
| 4 | |||
| 5 | public class Edge { | ||
| 6 | |||
| 7 | Node from, to; | ||
| 8 | String label; | ||
| 9 | |||
| 10 | public String getLabel() { return label; } | ||
| 11 | public Node getFromNode() { return from; } | ||
| 12 | public Node getToNode() {return to; } | ||
| 13 | public String getFromNodeName() { return from.name; } | ||
| 14 | public String getToNodeName() { return to.name; } | ||
| 15 | |||
| 16 | public Edge(Node u, Node v, String stringID) { | ||
| 17 | from = u; | ||
| 18 | to = v; | ||
| 19 | label = stringID; | ||
| 20 | } | ||
| 21 | |||
| 22 | public String toString() { | ||
| 23 | return label + "(\n\t" + from.name + ",\n\t" + to.name + ")"; | ||
| 24 | } | ||
| 25 | |||
| 26 | public static int compareLabels(Edge[] list1, Edge[] list2) { | ||
| 27 | int result = list1.length - list2.length; | ||
| 28 | if (result != 0) return result; | ||
| 29 | for (int i = 0; i < list1.length; ++i) { | ||
| 30 | if ((result = list1[i].label.compareTo(list2[i].label)) != 0) | ||
| 31 | return result; | ||
| 32 | } | ||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | |||
| 36 | public Node getDestinationNode(boolean isOutGoingEdges) { | ||
| 37 | return isOutGoingEdges ? to : from; | ||
| 38 | } | ||
| 39 | |||
| 40 | } | ||
| 41 | |||
| 42 | class EdgeComparatorByNodeName implements Comparator<Edge> { | ||
| 43 | |||
| 44 | @Override | ||
| 45 | public int compare(Edge o1, Edge o2) { | ||
| 46 | int result = o1.label.compareTo(o2.label); | ||
| 47 | if (result != 0) return result; | ||
| 48 | result = o1.from.name.compareTo(o2.from.name); | ||
| 49 | if (result != 0) return result; | ||
| 50 | return o1.to.name.compareTo(o2.to.name); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | class EdgeComparatorByNodeLabel implements Comparator<Edge> { | ||
| 55 | |||
| 56 | @Override | ||
| 57 | public int compare(Edge o1, Edge o2) { | ||
| 58 | int result = o1.label.compareTo(o2.label); | ||
| 59 | if (result != 0) return result; | ||
| 60 | result = o1.from.getLabel().compareTo(o2.from.getLabel()); | ||
| 61 | if (result != 0) return result; | ||
| 62 | result = o1.to.getLabel().compareTo(o2.to.getLabel()); | ||
| 63 | if (result != 0) return result; | ||
| 64 | result = o1.from.getName().compareTo(o2.from.getName()); | ||
| 65 | if (result != 0) return result; | ||
| 66 | result = o1.to.getName().compareTo(o2.to.getName()); | ||
| 67 | return result; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
