Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2017-02-08 22:41:50 +0000
committerTom Schindl2017-02-08 22:41:50 +0000
commitf8cbc544f2dbba6553251135f3426ec433f4927b (patch)
tree954454f0eb86241ab1cacd48fa50f99990cec271 /bundles/runtime
parentb90b296a6162a19db6370b20536fcc75fec886ce (diff)
downloadorg.eclipse.efxclipse-master.tar.gz
org.eclipse.efxclipse-master.tar.xz
org.eclipse.efxclipse-master.zip
object representing a rangeHEADmaster
Diffstat (limited to 'bundles/runtime')
-rw-r--r--bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Range.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Range.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Range.java
new file mode 100644
index 000000000..5de1cc84c
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Range.java
@@ -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;
+ }
+}

Back to the top