Commit 7604d175 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Added simple access to integer interval operations

parent 2d8b9497
...@@ -28,6 +28,7 @@ import java.util.List; ...@@ -28,6 +28,7 @@ import java.util.List;
public class Intervals { public class Intervals {
public static final Interval<Integer> EMPTY = emptyInterval(); public static final Interval<Integer> EMPTY = emptyInterval();
public static final IntegerIntervalOperations integerIntervalOperations = new IntegerIntervalOperations();
public static Interval<Integer> emptyInterval() { public static Interval<Integer> emptyInterval() {
if (EMPTY == null) { if (EMPTY == null) {
...@@ -48,9 +49,8 @@ public class Intervals { ...@@ -48,9 +49,8 @@ public class Intervals {
} }
/** /**
* Creates an interval ranging from start to end in zeroOpen coordinates. If * Creates an interval ranging from start to end in zeroOpen coordinates. If type is not ZeroOpen the start and end
* type is not ZeroOpen the start and end positions of the interval will be * positions of the interval will be transformed to be ZeroOpen.
* transformed to be ZeroOpen.
* *
* @param start The start of the interval. * @param start The start of the interval.
* @param end The end of the interval. * @param end The end of the interval.
...@@ -98,9 +98,12 @@ public class Intervals { ...@@ -98,9 +98,12 @@ public class Intervals {
return new IntervalFormatterBuilder<>(); return new IntervalFormatterBuilder<>();
} }
public static IntervalOperations<Integer> operations() {
return integerIntervalOperations;
}
/** /**
* Corrects the start depending on the type so that it can be used with a * Corrects the start depending on the type so that it can be used with a java String.
* java String.
* *
* @param start * @param start
* @param t * @param t
...@@ -118,8 +121,7 @@ public class Intervals { ...@@ -118,8 +121,7 @@ public class Intervals {
} }
/** /**
* Corrects the end depending on the type so that it can be used with a java * Corrects the end depending on the type so that it can be used with a java String.
* String.
* *
* @param end an end position * @param end an end position
* @param t the source type * @param t the source type
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment