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;
public class Intervals {
public static final Interval<Integer> EMPTY = emptyInterval();
public static final IntegerIntervalOperations integerIntervalOperations = new IntegerIntervalOperations();
public static Interval<Integer> emptyInterval() {
if (EMPTY == null) {
......@@ -48,9 +49,8 @@ public class Intervals {
}
/**
* Creates an interval ranging from start to end in zeroOpen coordinates. If
* type is not ZeroOpen the start and end positions of the interval will be
* transformed to be ZeroOpen.
* Creates an interval ranging from start to end in zeroOpen coordinates. If type is not ZeroOpen the start and end
* positions of the interval will be transformed to be ZeroOpen.
*
* @param start The start of the interval.
* @param end The end of the interval.
......@@ -75,9 +75,9 @@ public class Intervals {
Interval<Integer> normalized = normalize(interval);
return new SerializableInterval(
deNormalizeStart(normalized.getStart(), targetType),
deNormalizeEnd(normalized.getEnd(), targetType),
targetType);
deNormalizeStart(normalized.getStart(), targetType),
deNormalizeEnd(normalized.getEnd(), targetType),
targetType);
}
/**
......@@ -98,9 +98,12 @@ public class Intervals {
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
* java String.
* Corrects the start depending on the type so that it can be used with a java String.
*
* @param start
* @param t
......@@ -118,8 +121,7 @@ public class Intervals {
}
/**
* Corrects the end depending on the type so that it can be used with a java
* String.
* Corrects the end depending on the type so that it can be used with a java String.
*
* @param end an end position
* @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