Class Range

java.lang.Object
io.deephaven.web.shared.data.Range
All Implemented Interfaces:
Comparable<Range>

public class Range extends Object implements Comparable<Range>
Describes a contiguous range of at least one item. Equals/hashcode compare both start and end, but comparing Range instances will compare only by start - the overlap(Range) method should be used to see if two ranges share at least one item.
  • Constructor Details

    • Range

      public Range(long first, long last)
  • Method Details

    • getFirst

      public long getFirst()
    • getLast

      public long getLast()
    • compareTo

      public int compareTo(@Nonnull Range o)
      Specified by:
      compareTo in interface Comparable<Range>
    • overlap

      public Range overlap(Range range)
    • minus

      public Range[] minus(Range range)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • size

      public long size()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • shift

      public Range shift(long delta)