Edit StandardsList methods
@@ -36,10 +36,19 @@ public class StandardsList {
this.standardMolecules.sort(StandardsListItem.mzComparator);
}
+ /**
+ * Return a list of standard calibrants that are within given ranges of mz ratios and retention times
+ * when a null is given, the range is skipped / assumed to contain all mz or rt values
+ *
+ * @param mzRange
+ * @param rtSecRange
+ * @return
+ */
public ArrayList<StandardsListItem> getInRanges(Range<Double> mzRange, Range<Double> rtSecRange) {
ArrayList<StandardsListItem> withinRange = new ArrayList<>();
for (StandardsListItem molecule : standardMolecules) {
- if(mzRange.contains(molecule.getMzRatio()) && rtSecRange.contains(molecule.getRetentionTimeSec())){
+ if ((mzRange == null || mzRange.contains(molecule.getMzRatio()))
+ && (rtSecRange == null || rtSecRange.contains(molecule.getRetentionTimeSec()))) {
withinRange.add(molecule);
}
}
