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 PMMLIntervalelement.- See Also:
ContinuousStatistics, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInterval.ClosureEnumeration of allowed values for the "closure" attribute of theIntervalelement.
-
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)intcompareTo(Interval<T> o)First compares the left margins, then the right margins.booleanequals(Object o)Two intervals are equal if they have the same lower bound, upper bound, and closure.Interval.ClosuregetClosure()Returns the closure of the intervalTgetLeftMargin()Returns the lower bound of the intervalClass<?>getNumericType()TgetRightMargin()Returns the upper bound of the intervalinthashCode()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)StringtoString()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:
compareToin interfaceComparable<T extends Number & Comparable<? super T>>
-
-