public final class Interval<T extends Number & Comparable<? super T>> extends Object implements Comparable<Interval<T>>, Serializable
Interval
element.ContinuousStatistics
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
Interval.Closure
Enumeration of allowed values for the "closure" attribute of the
Interval element. |
Constructor and Description |
---|
Interval(Interval.Closure closure,
T leftMargin,
T rightMargin)
Creates a new interval
|
Modifier and Type | Method and Description |
---|---|
static <T extends Number & Comparable<? super T>> |
closedClosed(T left,
T right)
Creates an interval [left,right]
|
static <T extends Number & Comparable<? super T>> |
closedOpen(T left,
T right)
Creates an interval [left,right)
|
int |
compareTo(Interval<T> o)
First compares the left margins, then the right margins.
|
boolean |
equals(Object o)
Two intervals are equal if they have the same lower bound, upper bound, and closure.
|
Interval.Closure |
getClosure()
Returns the closure of the interval
|
T |
getLeftMargin()
Returns the lower bound of the interval
|
Class<?> |
getNumericType() |
T |
getRightMargin()
Returns the upper bound of the interval
|
int |
hashCode()
Returns hashCode consistent with equals.
|
static <T extends Number & Comparable<? super T>> |
openClosed(T left,
T right)
Creates an interval (left,right]
|
static <T extends Number & Comparable<? super T>> |
openOpen(T left,
T right)
Creates an interval (left,right)
|
String |
toString()
Returns a pretty-printed string of the form
[lower,upper] |
public Interval(Interval.Closure closure, T leftMargin, T rightMargin)
closure
- the closure of the intervalleftMargin
- the lower bound of the intervalrightMargin
- the upper bound of the intervalpublic static <T extends Number & Comparable<? super T>> Interval<T> openClosed(T left, T right)
left
- the leftright
- the rightpublic static <T extends Number & Comparable<? super T>> Interval<T> openOpen(T left, T right)
left
- the leftright
- the rightpublic static <T extends Number & Comparable<? super T>> Interval<T> closedOpen(T left, T right)
left
- the leftright
- the rightpublic static <T extends Number & Comparable<? super T>> Interval<T> closedClosed(T left, T right)
left
- the leftright
- the rightpublic Interval.Closure getClosure()
public T getLeftMargin()
public T getRightMargin()
public Class<?> getNumericType()
public boolean equals(Object o)
public int hashCode()
public int compareTo(Interval<T> o)
compareTo
in interface Comparable<Interval<T extends Number & Comparable<? super T>>>
Copyright © 2024 Actian Corporation. All rights reserved.