java.lang.Object
org.jfree.chart3d.data.Range
- All Implemented Interfaces:
Serializable
Represents a range of data values (instances are immutable).
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double value) Returnstrueif the range includes the specified value, andfalseotherwise.booleanTests this instance for equality with an arbitrary object.doubleReturns the length of the range.doublegetMax()Returns the upper bound of the range.doublegetMin()Returns the lower bound of the range.inthashCode()Returns a hash code for this instance.booleanintersects(double bound1, double bound2) Returnstrueif the range intersects the interval defined by the two bounds (the order of the bounds is not important), andfalseotherwise.booleanintersects(Range range) Returnstrueif this range intersects with the specified range, andfalseotherwise.doublepeggedValue(double value) Returns either (a) the supplied value, if it falls within the range, or (b) the range minimum or maximum value, whichever is closest to value.doublepercent(double value) Returns the value as a percentage along the range.doublepercent(double value, boolean inverted) Returns the value as a percentage along the range, with optionally the result inverted (that is, p becomes 1.0 - p).toString()Returns a string representation of this instance, primarily for debugging purposes.doublevalue(double percent) Returns the value corresponding to the specified percentage.
-
Constructor Details
-
Range
Creates a new range instance.- Parameters:
min- the lower bound of the range.max- the upper bound of the range.
-
-
Method Details
-
getMin
Returns the lower bound of the range.- Returns:
- The lower bound of the range.
-
getMax
Returns the upper bound of the range.- Returns:
- The upper bound of the range.
-
getLength
Returns the length of the range.- Returns:
- The length of the range.
-
contains
Returnstrueif the range includes the specified value, andfalseotherwise.- Parameters:
value- the value.- Returns:
- A boolean.
-
peggedValue
Returns either (a) the supplied value, if it falls within the range, or (b) the range minimum or maximum value, whichever is closest to value.- Parameters:
value- the value.- Returns:
- The pegged value.
-
intersects
Returnstrueif the range intersects the interval defined by the two bounds (the order of the bounds is not important), andfalseotherwise.- Parameters:
bound1- the first boundary value.bound2- the second boundary value.- Returns:
- A boolean.
-
intersects
Returnstrueif this range intersects with the specified range, andfalseotherwise.- Parameters:
range- the range (nullnot permitted).- Returns:
- A boolean.
- Since:
- 1.2
-
percent
Returns the value as a percentage along the range.- Parameters:
value- the value.- Returns:
- The percentage.
-
percent
Returns the value as a percentage along the range, with optionally the result inverted (that is, p becomes 1.0 - p).- Parameters:
value- the value.inverted- invert the result?- Returns:
- The percentage.
- Since:
- 1.5
-
value
Returns the value corresponding to the specified percentage.- Parameters:
percent- the percentage along the range.- Returns:
- The value.
- Since:
- 1.1
-
equals
Tests this instance for equality with an arbitrary object. -
hashCode
Returns a hash code for this instance. -
toString
Returns a string representation of this instance, primarily for debugging purposes.
-