Interval

public class Interval extends Box<T>

Immutable data type that represents an interval over the set of real numbers (here limited to doubles).

See also

Constructors

Link copied to clipboard
public void Interval()
Constructs an empty Interval
public void Interval(Number value)
Constructs a degenerated interval of the kind [value, value]
public void Interval(Number start, Number end)
Constructs an interval of the kind [start, end]
public void Interval(Number start, Number end, boolean openOnRight)
Constructs an interval of the kind [start, end) or [start, end]
public void Interval(Number start, Number end, boolean openOnLeft, boolean openOnRight)
Constructs an interval of any kind between start and end

Properties

Link copied to clipboard
public final T end
Link copied to clipboard
public final T start

Functions

Link copied to clipboard
public static Interval any()
Link copied to clipboard
public Box<R> apply<R extends Comparable<R>>(Function<T, R> f)
Link copied to clipboard
public static Interval combine(@NotNull() @NotNull() Interval i1, @NotNull() @NotNull() Interval i2)
Generates a new interval by combining two of them
Link copied to clipboard
public int compareTo(@NotNull() @NotNull() Box<T> o)
Note that in classical interval arithmetic no total ordering relation is defined over intervals.
public abstract int compareTo(T p)
Link copied to clipboard
public boolean contains(T value)
Checks whether the passed value belongs to the interval
public boolean contains(Box<? extends Object> target)
Non-strict set containment between intervals
Link copied to clipboard
public boolean equals(Object obj)
Link copied to clipboard
public T getEnd()
Link copied to clipboard
public T getStart()
Link copied to clipboard
public int hashCode()
Link copied to clipboard
public boolean isEmpty()
Link copied to clipboard
public boolean isOpenOnLeft()
Link copied to clipboard
public boolean isOpenOnRight()
Link copied to clipboard
public String toString()
Link copied to clipboard
public Interval translate(Double offset)