T
- The type of the underlying values of this range.public abstract class RangeBase<T extends java.lang.Comparable<T>> extends java.lang.Object implements IRange<T>
IRange
, used throughout SciChart for visible, data and index range calculations.Modifier | Constructor and Description |
---|---|
protected |
RangeBase(RangeBase<T> range,
IMath<T> math)
Creates a new instance of
RangeBase . |
protected |
RangeBase(T min,
T max,
IMath<T> math)
Creates a new instance of
RangeBase |
Modifier and Type | Method and Description |
---|---|
void |
addRangeChangeObserver(IRangeChangeObserver<T> observer)
Adds
IRangeChangeObserver instance to listen changes of this IRange instance |
void |
clipTo(IRange<T> maximumRange)
Clips the current
IRange to a maximum range with MinMax mode |
void |
clipTo(IRange<T> maximumRange,
RangeClipMode clipMode)
Clips the current
IRange to a maximum according to clip mode |
abstract IRange<T> |
clone()
Creates and returns a copy of this object
|
boolean |
equals(java.lang.Object o) |
T |
getDiff()
Gets the difference (max - min) of this range
|
boolean |
getIsDefined()
Gets whether this Range is defined
|
boolean |
getIsMinMaxValid()
Gets whether the min and max value are valid ( min <= max )
|
boolean |
getIsZero()
Gets whether the range is Zero, where max equals min
|
IMath<T> |
getMath()
Gets the
IMath associated with this range |
T |
getMax()
Gets the max value of this range
|
T |
getMin()
Gets the min value of this range
|
int |
hashCode() |
boolean |
isValueWithinRange(T value)
Returns true if the value is within the min and max of the Range
|
void |
removeRangeChangeObserver(IRangeChangeObserver<T> observer)
Removes
IRangeChangeObserver instance from list of change listeners for this IRange instance |
void |
set(IRange<T> range)
Sets the min, max values on the
IRange with a range |
void |
setMax(T max)
Sets the max value of this range
|
void |
setMin(T min)
Sets the min value of this range
|
void |
setMinMax(T min,
T max)
Sets the min, max values on the
IRange |
void |
setMinMaxDouble(double min,
double max)
Sets the min, max values on the
IRange |
void |
setMinMaxDoubleForced(double min,
double max)
Sets the min, max values on the
IRange without equals checks |
void |
setMinMaxForced(T min,
T max)
Sets the min, max values on the
IRange without equals checks |
void |
setMinMaxWithLimit(double min,
double max,
IRange<T> maximumRange)
Sets the min, max values on the
IRange with a max range
to clip values to |
java.lang.String |
toString() |
void |
union(IRange<T> range)
Performs the union of two
IRange instances |
void |
union(T min,
T max)
Performs the union of two
IRange instances |
finalize, getClass, notify, notifyAll, wait, wait, wait
getMaxAsDouble, getMinAsDouble, getValueType, growBy
protected RangeBase(RangeBase<T> range, IMath<T> math)
RangeBase
.public final T getMax()
public final void setMax(T max)
public final T getMin()
public final void setMin(T min)
public T getDiff()
public final void setMinMaxForced(T min, T max)
IRange
without equals checkssetMinMaxForced
in interface IRange<T extends java.lang.Comparable<T>>
min
- New min valuemax
- New max valuepublic final void setMinMaxWithLimit(double min, double max, IRange<T> maximumRange)
IRange
with a max range
to clip values tosetMinMaxWithLimit
in interface IRange<T extends java.lang.Comparable<T>>
min
- New min valuemax
- New max valuemaximumRange
- The max range, which is used to clip valuespublic final void setMinMaxDouble(double min, double max)
IRange
setMinMaxDouble
in interface IRange<T extends java.lang.Comparable<T>>
min
- New min valuemax
- New max valuepublic final void setMinMaxDoubleForced(double min, double max)
IRange
without equals checkssetMinMaxDoubleForced
in interface IRange<T extends java.lang.Comparable<T>>
min
- New min valuemax
- New max valuepublic boolean getIsDefined()
getIsDefined
in interface IRange<T extends java.lang.Comparable<T>>
public boolean getIsZero()
public final boolean getIsMinMaxValid()
getIsMinMaxValid
in interface IRange<T extends java.lang.Comparable<T>>
public final boolean isValueWithinRange(T value)
isValueWithinRange
in interface IRange<T extends java.lang.Comparable<T>>
value
- the value to testpublic final void clipTo(IRange<T> maximumRange)
IRange
to a maximum range with MinMax modepublic final void clipTo(IRange<T> maximumRange, RangeClipMode clipMode)
IRange
to a maximum according to clip modepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public final void addRangeChangeObserver(IRangeChangeObserver<T> observer)
IRangeChangeObserver
instance to listen changes of this IRange
instanceaddRangeChangeObserver
in interface IRange<T extends java.lang.Comparable<T>>
observer
- The observer to addpublic final void removeRangeChangeObserver(IRangeChangeObserver<T> observer)
IRangeChangeObserver
instance from list of change listeners for this IRange
instanceremoveRangeChangeObserver
in interface IRange<T extends java.lang.Comparable<T>>
observer
- The observer to removepublic abstract IRange<T> clone() throws java.lang.CloneNotSupportedException
clone
in interface IRange<T extends java.lang.Comparable<T>>
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the object's class does not
support the Cloneable
interface. Subclasses
that override the clone
method can also
throw this exception to indicate that an instance cannot
be cloned.