Module datarush.analytics
Class Interval<T extends Number & Comparable<? super T>>
- java.lang.Object
-
- com.pervasive.datarush.analytics.stats.Interval<T>
-
- All Implemented Interfaces:
Serializable
,Comparable<Interval<T>>
public final class Interval<T extends Number & Comparable<? super T>> extends Object implements Comparable<Interval<T>>, Serializable
Object representation of the PMMLInterval
element.- See Also:
ContinuousStatistics
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Interval.Closure
Enumeration of allowed values for the "closure" attribute of theInterval
element.
-
Constructor Summary
Constructors Constructor Description Interval(Interval.Closure closure, T leftMargin, T rightMargin)
Creates a new interval
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends Number & Comparable<? super T>>
Interval<T>closedClosed(T left, T right)
Creates an interval [left,right]static <T extends Number & Comparable<? super T>>
Interval<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 intervalT
getLeftMargin()
Returns the lower bound of the intervalClass<?>
getNumericType()
T
getRightMargin()
Returns the upper bound of the intervalint
hashCode()
Returns hashCode consistent with equals.static <T extends Number & Comparable<? super T>>
Interval<T>openClosed(T left, T right)
Creates an interval (left,right]static <T extends Number & Comparable<? super T>>
Interval<T>openOpen(T left, T right)
Creates an interval (left,right)String
toString()
Returns a pretty-printed string of the form[lower,upper]
-
-
-
Constructor Detail
-
Interval
public Interval(Interval.Closure closure, T leftMargin, T rightMargin)
Creates a new interval- Parameters:
closure
- the closure of the intervalleftMargin
- the lower bound of the intervalrightMargin
- the upper bound of the interval
-
-
Method Detail
-
openClosed
public static <T extends Number & Comparable<? super T>> Interval<T> openClosed(T left, T right)
Creates an interval (left,right]- Parameters:
left
- the leftright
- the right- Returns:
- an internal (left,right]
-
openOpen
public static <T extends Number & Comparable<? super T>> Interval<T> openOpen(T left, T right)
Creates an interval (left,right)- Parameters:
left
- the leftright
- the right- Returns:
- an internal (left,right)
-
closedOpen
public static <T extends Number & Comparable<? super T>> Interval<T> closedOpen(T left, T right)
Creates an interval [left,right)- Parameters:
left
- the leftright
- the right- Returns:
- an internal [left,right)
-
closedClosed
public static <T extends Number & Comparable<? super T>> Interval<T> closedClosed(T left, T right)
Creates an interval [left,right]- Parameters:
left
- the leftright
- the right- Returns:
- an internal [left,right]
-
getClosure
public Interval.Closure getClosure()
Returns the closure of the interval- Returns:
- the closure of the interval
-
getLeftMargin
public T getLeftMargin()
Returns the lower bound of the interval- Returns:
- the lower bound of the interval
-
getRightMargin
public T getRightMargin()
Returns the upper bound of the interval- Returns:
- the upper bound of the interval
-
getNumericType
public Class<?> getNumericType()
-
equals
public boolean equals(Object o)
Two intervals are equal if they have the same lower bound, upper bound, and closure.
-
hashCode
public int hashCode()
Returns hashCode consistent with equals.
-
compareTo
public int compareTo(Interval<T> o)
First compares the left margins, then the right margins. Closure is not considered when comparing intervals.- Specified by:
compareTo
in interfaceComparable<T extends Number & Comparable<? super T>>
-
-