Skip to content

Commit

Permalink
Merge pull request #1587 from NASA-AMMOS/fix/switch-filter-by-duraitons
Browse files Browse the repository at this point in the history
Switch semantics of filterLongerThan and filterShorterThan
  • Loading branch information
dandelany authored Nov 5, 2024
2 parents 5c2da25 + 3801157 commit 35c97fe
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ interface GeneralOps<V: IntervalLike<V>, THIS: GeneralOps<V, THIS>>: Timeline<V,
*/
fun filterByDuration(validInterval: Interval) = filter(true) { validInterval.contains(it.interval.duration()) }

/** [(DOC)][filterShorterThan] Removes objects whose duration is shorter than a given duration. */
fun filterShorterThan(dur: Duration) = filter(true) { it.interval.duration() >= dur }
/** [(DOC)][filterLongerThan] Removes objects whose duration is longer than a given duration. */
fun filterLongerThan(dur: Duration) = filter(true) { it.interval.duration() <= dur }
/** [(DOC)][filterShorterThan] Removes objects whose duration is longer than a given duration. */
fun filterShorterThan(dur: Duration) = filter(true) { it.interval.duration() <= dur }
/** [(DOC)][filterLongerThan] Removes objects whose duration is shorter than a given duration. */
fun filterLongerThan(dur: Duration) = filter(true) { it.interval.duration() >= dur }

/**
* [(DOC)][filterByWindows] Filters out payload objects whose intervals are not contained in the
Expand Down

0 comments on commit 35c97fe

Please sign in to comment.