Package com.bayesserver
Class Interval<T extends Comparable>
- java.lang.Object
-
- com.bayesserver.Interval<T>
-
- Type Parameters:
T- The data type used in the interval. E.g.Double.
- All Implemented Interfaces:
Comparable<T>
public final class Interval<T extends Comparable> extends Object implements Comparable<T>
An interval, defined by a minimum and maximum with respective open or closed endpoints.
-
-
Constructor Summary
Constructors Constructor Description Interval()Interval(T minimum, T maximum, IntervalEndPoint minimumEndPoint, IntervalEndPoint maximumEndPoint)Initializes a new instance of an Interval.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(T value)booleancontains(T value)Determines whether a value is within this interval.booleanequals(Object obj)TgetMaximum()Gets the maximum interval value.IntervalEndPointgetMaximumEndPoint()Gets the end point type for the maximum value of the interval.TgetMinimum()Gets the minimum interval value.IntervalEndPointgetMinimumEndPoint()Gets the end point type for the minimum value of the interval.inthashCode()voidsetMaximum(T value)Sets the maximum interval value.voidsetMaximumEndPoint(IntervalEndPoint value)Sets the end point type for the maximum value of the interval.voidsetMinimum(T value)Sets the minimum interval value.voidsetMinimumEndPoint(IntervalEndPoint value)Sets the end point type for the minimum value of the interval.StringtoString()
-
-
-
Constructor Detail
-
Interval
public Interval(T minimum, T maximum, IntervalEndPoint minimumEndPoint, IntervalEndPoint maximumEndPoint)
Initializes a new instance of an Interval.- Parameters:
minimum- The minimum value in the interval.maximum- The maximum value in the interval.minimumEndPoint- The end point type for the minimum value.maximumEndPoint- The end point type for the maximum value.
-
Interval
public Interval()
-
-
Method Detail
-
getMaximum
public T getMaximum()
Gets the maximum interval value.- Returns:
- The maximum value in the interval.
-
setMaximum
public void setMaximum(T value)
Sets the maximum interval value.- Parameters:
value- The maximum value in the interval.
-
getMaximumEndPoint
public IntervalEndPoint getMaximumEndPoint()
Gets the end point type for the maximum value of the interval.
-
setMaximumEndPoint
public void setMaximumEndPoint(IntervalEndPoint value)
Sets the end point type for the maximum value of the interval.
-
getMinimum
public T getMinimum()
Gets the minimum interval value.- Returns:
- The minimum value in the interval.
-
setMinimum
public void setMinimum(T value)
Sets the minimum interval value.- Parameters:
value- The minimum value in the interval.
-
getMinimumEndPoint
public IntervalEndPoint getMinimumEndPoint()
Gets the end point type for the minimum value of the interval.
-
setMinimumEndPoint
public void setMinimumEndPoint(IntervalEndPoint value)
Sets the end point type for the minimum value of the interval.
-
contains
public boolean contains(T value)
Determines whether a value is within this interval.- Parameters:
value- The value to check.- Returns:
trueif the value is contained in the interval,falseotherwise.
-
compareTo
public int compareTo(T value)
- Specified by:
compareToin interfaceComparable<T extends Comparable>
-
-