Conversation
|
Still requires some implementation of default behaviour, but depends on the discussion about API definitions. |
| * @author Daniel Gomez-Sanchez (magicDGS) | ||
| * @implSpec note that 0-length intervals are allowed in an implementation-dependent manner. | ||
| */ | ||
| public interface Locatable { |
There was a problem hiding this comment.
Maybe we should extend Comparable, but I think that it will be better to have a LocatableComparator instead to allow different comprators to be use
There was a problem hiding this comment.
I don't think this should be comparable because there's no single consistent comparator, it depends on how you want to sort he chromosomes.
| * @see #getStart() | ||
| * @see #getEnd() | ||
| */ | ||
| default OptionalLong getLengthOnReference() { |
There was a problem hiding this comment.
I thought about not implementing this in the interface, but an utility class instead which throws if no end is provided.
There was a problem hiding this comment.
Forget about this comment.
| * @implSpec should return {@code false} if {@code referenceMatch(other) == false}. | ||
| * @see #withinDistanceOf(Locatable, int) | ||
| */ | ||
| default boolean overlaps(Locatable other) { |
There was a problem hiding this comment.
We can add also more methods to pad/merge/etc. to make the interface complete...
| * with respect to a reference). | ||
| * </p> | ||
| * | ||
| * @author Daniel Gomez-Sanchez (magicDGS) |
There was a problem hiding this comment.
Do we want author's tags in the new code? My feeling has been that they rapidly become out of date and are handled better by git history. Do others feel differently?
There was a problem hiding this comment.
Was the default in my IDE - will remove!
| * > getEnd()}). | ||
| * @see #getStart() | ||
| */ | ||
| OptionalLong getEnd(); |
There was a problem hiding this comment.
Why make this optional? In a 1-based system a point just has end == start. Better to just require it I think and a point class can avoid storing it if they want. Adding an optional adds boxing overhead and complexity.
| @@ -0,0 +1,140 @@ | |||
| package org.samtools.htsjdk.core; | |||
There was a problem hiding this comment.
How do you feel by making a package that is called org.samtools.htsjdk.core.api for the core interfaces and then a implementation-specific package? For example (just care about the api name, the rest are just first idea of how to name specific implementations):
Readinterface in theapipackage, andSAMRecordimplementation inorg.samtools.htsjdk.core.samVariantinterface in theapipackage, andVCFRecordimplementation inorg.samtools.htsjdk.core.vcf
6c79a97 to
4622ded
Compare
|
Rebased into the latest master (build system parts are removed). |
4622ded to
cda6f0a
Compare
cda6f0a to
03abb3d
Compare
No description provided.