File tree Expand file tree Collapse file tree
client-api/src/main/java/io/deephaven/web/client/api
shared-beans/src/main/java/io/deephaven/web/shared/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ public class JsRangeSet {
2424 private final RangeSet range ;
2525
2626 public static JsRangeSet ofRange (double first , double last ) {
27+ if (first > last ) {
28+ throw new IllegalStateException (first + " > " + last );
29+ }
2730 return new JsRangeSet (RangeSet .ofRange ((long ) first , (long ) last ));
2831 }
2932
Original file line number Diff line number Diff line change 44package io .deephaven .web .shared .data ;
55
66import javax .annotation .Nonnull ;
7- import java .io .Serializable ;
87
98/**
109 * Describes a contiguous range of at least one item. Equals/hashcode compare both start and end, but comparing Range
@@ -15,15 +14,7 @@ public class Range implements Comparable<Range> {
1514 private final long first ;
1615 private final long last ;
1716
18- // serialization
19- Range () {
20- this (0 , 0 );
21- }
22-
2317 public Range (long first , long last ) {
24- if (first > last ) {
25- throw new IllegalStateException (first + " > " + last );
26- }
2718 this .first = first ;
2819 this .last = last ;
2920 }
@@ -70,13 +61,10 @@ public Range[] minus(Range range) {
7061 // otherwise either the subtracted section's start is within our range _or_ its end is within our range,
7162 // and we can use that to only produce the one range we need to return
7263 if (range .first <= first ) {
73- assert range .last >= first : "removed range expected to not end before existing range" ;
7464 return new Range [] {
7565 new Range (range .last + 1 , last )
7666 };
7767 } else {
78- assert range .last >= last : "removed range expected to end by the end of the existing range" ;
79- assert range .first <= last : "removed range expected to start before existing range" ;
8068 return new Range [] {
8169 new Range (first , range .first - 1 )
8270 };
You can’t perform that action at this time.
0 commit comments