Skip to content

Commit

Permalink
object representing a range
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsontom committed Feb 8, 2017
1 parent b90b296 commit f8cbc54
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.eclipse.fx.core;

public class Range {
public final int start;
public final int end;

public Range(int start, int end) {
this.start = start;
this.end = end;
}

public static boolean intersects(int start1, int end1, int start2, int end2) {
return between(start1, end1, start2) || between(start1, end1, end2);
}

public static boolean between(int start, int end, int value) {
return start <= value && end >= value;
}
}

0 comments on commit f8cbc54

Please sign in to comment.