+class LocPair {
+ public String nonShared;
+ public String shared;
+
+ public int hashCode() {
+ int h = 0;
+ if (nonShared != null) {
+ h = nonShared.hashCode();
+ }
+ if (shared != null) {
+ h = shared.hashCode();
+ }
+ return h;
+ }
+
+ public boolean equals(Object obj) {
+
+ if (obj instanceof LocPair) {
+ LocPair in = (LocPair) obj;
+
+ if ((nonShared == null && in.nonShared == null)
+ || (nonShared != null && nonShared.equals(in.nonShared))) {
+
+ if ((shared == null && in.shared == null) || (shared != null && shared.equals(in.shared))) {
+ return true;
+ }
+
+ }
+
+ }
+
+ return false;
+ }
+
+ public String toString() {
+ String rtr = "<" + nonShared + "," + shared + ">";
+ return rtr;
+ }
+}
+
+class LineIdentifier {
+ public String startLoc;
+ public Set<String> lowerLocSet;
+
+ public LineIdentifier(String s, Set<String> lSet) {
+ startLoc = s;
+ lowerLocSet = lSet;
+ }
+
+ public int hashCode() {
+ int h = 0;
+ h = startLoc.hashCode();
+ return h + lowerLocSet.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+
+ if (obj instanceof LineIdentifier) {
+ LineIdentifier in = (LineIdentifier) obj;
+ if (startLoc.equals(in.startLoc) && lowerLocSet.equals(in.lowerLocSet)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public String toString() {
+ String rtr = startLoc + "->" + lowerLocSet;
+ return rtr;
+ }
+
+}
+
+class InterLocItem {
+ public String startLoc;
+ public Set<String> lowerLocSet;
+ public int idx;
+
+ public InterLocItem(String h, Set<String> l, int i) {
+ startLoc = h;
+ lowerLocSet = l;
+ idx = i;
+ }
+
+ public int hashCode() {
+
+ int h = 0;
+ if (startLoc != null) {
+ h = startLoc.hashCode();
+ }
+
+ return h + lowerLocSet.hashCode() + idx;
+ }
+
+ public boolean equals(Object obj) {
+
+ if (obj instanceof InterLocItem) {
+ InterLocItem in = (InterLocItem) obj;
+ if ((startLoc == null || (startLoc != null && startLoc.equals(in.startLoc)))
+ && lowerLocSet.equals(in.lowerLocSet) && idx == in.idx) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public String toString() {
+ String rtr = startLoc + "-" + idx + "->" + lowerLocSet;
+ if (idx % 2 != 0) {
+ rtr += " S";
+ }
+ return rtr;
+ }
+}
+