Top Description Fields Constructors Methods
org.apache.commons.math3.geometry.euclidean.oned

public Class Interval

extends Object
Class Inheritance
Imports
org.apache.commons.math3.geometry.partitioning.Region.Location, org.apache.commons.math3.exception.NumberIsTooSmallException, org.apache.commons.math3.exception.util.LocalizedFormats

This class represents a 1D interval.
Since
3.0
See Also
IntervalsSet

Field Summary

Modifier and TypeField and Description
private final double
lower

The lower bound of the interval.

private final double
upper

The upper bound of the interval.

Constructor Summary

AccessConstructor and Description
public
Interval(final double
lower bound of the interval
lower
,
final double
upper bound of the interval
upper
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
public Region.Location

Returns:

a code representing the point status: either Location#INSIDE, Location#OUTSIDE or Location#BOUNDARY
checkPoint
(final double
point to check
point
,
final double
tolerance below which points are considered to belong to the boundary
tolerance
)

Check a point with respect to the interval.

public double

Returns:

barycenter of the interval
getBarycenter
()

Get the barycenter of the interval.

public double

Returns:

lower bound of the interval
getInf
()

Get the lower bound of the interval.

public double

Returns:

length of the interval
getLength
()
Deprecated as of 3.1, replaced by getSize()

Get the length of the interval.

public double

Returns:

lower bound of the interval
getLower
()
Deprecated as of 3.1, replaced by getInf()

Get the lower bound of the interval.

public double

Returns:

midpoint of the interval
getMidPoint
()
Deprecated as of 3.1, replaced by getBarycenter()

Get the midpoint of the interval.

public double

Returns:

size of the interval
getSize
()

Get the size of the interval.

public double

Returns:

upper bound of the interval
getSup
()

Get the upper bound of the interval.

public double

Returns:

upper bound of the interval
getUpper
()
Deprecated as of 3.1, replaced by getSup()

Get the upper bound of the interval.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lowerback to summary
private final double lower

The lower bound of the interval.

upperback to summary
private final double upper

The upper bound of the interval.

Constructor Detail

Intervalback to summary
public Interval(final double lower, final double upper)

Simple constructor.

Parameters
lower:double

lower bound of the interval

upper:double

upper bound of the interval

Method Detail

checkPointback to summary
public Region.Location checkPoint(final double point, final double tolerance)

Check a point with respect to the interval.

Parameters
point:double

point to check

tolerance:double

tolerance below which points are considered to belong to the boundary

Returns:Region.Location

a code representing the point status: either Location#INSIDE, Location#OUTSIDE or Location#BOUNDARY

Since
3.1
getBarycenterback to summary
public double getBarycenter()

Get the barycenter of the interval.

Returns:double

barycenter of the interval

Since
3.1
getInfback to summary
public double getInf()

Get the lower bound of the interval.

Returns:double

lower bound of the interval

Since
3.1
getLengthback to summary
public double getLength()

Deprecated

as of 3.1, replaced by getSize()

Get the length of the interval.

Returns:double

length of the interval

Annotations
@Deprecated
getLowerback to summary
public double getLower()

Deprecated

as of 3.1, replaced by getInf()

Get the lower bound of the interval.

Returns:double

lower bound of the interval

Annotations
@Deprecated
getMidPointback to summary
public double getMidPoint()

Deprecated

as of 3.1, replaced by getBarycenter()

Get the midpoint of the interval.

Returns:double

midpoint of the interval

Annotations
@Deprecated
getSizeback to summary
public double getSize()

Get the size of the interval.

Returns:double

size of the interval

Since
3.1
getSupback to summary
public double getSup()

Get the upper bound of the interval.

Returns:double

upper bound of the interval

Since
3.1
getUpperback to summary
public double getUpper()

Deprecated

as of 3.1, replaced by getSup()

Get the upper bound of the interval.

Returns:double

upper bound of the interval

Annotations
@Deprecated