|
|
@@ -6,15 +6,15 @@ public class Match {
|
|
|
public int startB;
|
|
|
public int length;
|
|
|
|
|
|
+ public Match() {
|
|
|
+ }
|
|
|
+
|
|
|
public Match(int startA, int startB, int length) {
|
|
|
this.startA = startA;
|
|
|
this.startB = startB;
|
|
|
this.length = length;
|
|
|
}
|
|
|
|
|
|
- public Match() {
|
|
|
- }
|
|
|
-
|
|
|
public void set(int startA, int startB, int length) {
|
|
|
this.startA = startA;
|
|
|
this.startB = startB;
|
|
|
@@ -27,25 +27,7 @@ public class Match {
|
|
|
}
|
|
|
|
|
|
public final boolean overlap(Match other) {
|
|
|
- if (startA < other.startA) {
|
|
|
- if ((other.startA - startA) < length) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ((startA - other.startA) < other.length) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (startB < other.startB) {
|
|
|
- if ((other.startB - startB) < length) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ((startB - other.startB) < other.length) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
+ return overlap(other.startA, other.startB, other.length);
|
|
|
}
|
|
|
|
|
|
public final boolean overlap(int oStartA, int oStartB, int oLength) {
|
|
|
@@ -58,16 +40,12 @@ public class Match {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (startB < oStartB) {
|
|
|
- if ((oStartB - startB) < length) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ return (oStartB - startB) < length;
|
|
|
} else {
|
|
|
- if ((startB - oStartB) < oLength) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ return (startB - oStartB) < oLength;
|
|
|
}
|
|
|
- return false;
|
|
|
}
|
|
|
}
|
|
|
|