Added a secondary constructor to IntervalList that takes a dict. #703

Merged
merged 1 commit into from Sep 13, 2016
Jump to file or symbol
Failed to load files and symbols.
+13 −4
Split
@@ -120,6 +120,12 @@ public SAMFileHeader() {
setAttribute(VERSION_TAG, CURRENT_VERSION);
}
+ /** Constructor that initializes the sequence dictionary with the provided one. */
+ public SAMFileHeader(final SAMSequenceDictionary dict) {
+ this();
+ setSequenceDictionary(dict);
+ }
+
public String getVersion() {
return (String) getAttribute("VN");
}
@@ -71,12 +71,15 @@
/** Constructs a new interval list using the supplied header information. */
public IntervalList(final SAMFileHeader header) {
- if (header == null) {
- throw new IllegalArgumentException("SAMFileHeader must be supplied.");
- }
+ if (header == null) throw new IllegalArgumentException("SAMFileHeader must be supplied.");
this.header = header;
}
+ /** Constructs a new interval list using the supplied header information. */
+ public IntervalList(final SAMSequenceDictionary dict) {
+ this(new SAMFileHeader(dict));
+ }
+
/** Gets the header (if there is one) for the interval list. */
public SAMFileHeader getHeader() { return header; }
@@ -769,4 +772,4 @@ public int compare(final Interval lhs, final Interval rhs) {
return retval;
}
-}
+}