Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GenDB3
lib.intervals
Commits
7604d175
Commit
7604d175
authored
Nov 27, 2013
by
Lukas Jelonek
Browse files
Added simple access to integer interval operations
parent
2d8b9497
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/cebitec/common/sequencetools/intervals/Intervals.java
View file @
7604d175
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment