public class Range
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
double |
max
The range
|
double |
min
The range
|
Constructor and Description |
---|
Range()
Default ctor
|
Range(double[] a)
ctor
|
Range(double min,
double max)
Create a range with min, max
|
Range(double min,
double max,
java.lang.String name)
Create a range with min, max and name
|
Range(Range r)
copy ctor
|
Modifier and Type | Method and Description |
---|---|
double[] |
asArray()
Get a 2-aray array holding min/max
|
float[] |
asFloatArray()
Get a 2-aray array holding min/max
|
boolean |
equals(java.lang.Object o)
Equals
|
java.lang.String |
formatMax()
Format the max value
|
java.lang.String |
formatMid()
Format the mid value
|
java.lang.String |
formatMin()
Format the min value
|
double |
getAbsSpan()
get abs(max-min)
|
double |
getMax()
Get the max
|
int |
getMaxInt()
Get int value of max
|
double |
getMid()
Get the mid point
|
int |
getMidInt()
Get the int value of mid point
|
double |
getMin()
Get the min
|
int |
getMinInt()
Get int value of min
|
java.lang.String |
getName()
Get the Name property.
|
double |
getPercent(double v)
Ge tthe percent the given value is between min and max
|
double |
getSpan()
max-min
|
int |
getSpanInt()
Get the int value of the span (the difference between max and min)
|
double |
getValueOfPercent(double percent)
Get percent along the way between min and max
|
void |
set(double min,
double max)
set the values
|
void |
setMax(double v)
Set the max
|
void |
setMax(int v)
Set the max
|
void |
setMin(double v)
Set the min
|
void |
setMin(int v)
Set the min
|
void |
setName(java.lang.String value)
Set the Name property.
|
double |
span()
max-min
|
java.lang.String |
toString()
to string
|
public Range()
public Range(double min, double max)
min
- minmax
- maxpublic Range(double min, double max, java.lang.String name)
min
- minmax
- maxname
- namepublic Range(double[] a)
a
- 2-ary array holding min/maxpublic Range(Range r)
r
- objectpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Objectpublic void set(double min, double max)
min
- minmax
- maxpublic java.lang.String formatMin()
public java.lang.String formatMid()
public java.lang.String formatMax()
public double getMin()
public double getMax()
public void setMin(double v)
v
- valuepublic void setMax(double v)
v
- valuepublic int getSpanInt()
public int getMinInt()
public int getMaxInt()
public void setMin(int v)
v
- valuepublic void setMax(int v)
v
- valuepublic double[] asArray()
public float[] asFloatArray()
public double span()
public double getSpan()
public double getAbsSpan()
public double getMid()
public int getMidInt()
public double getValueOfPercent(double percent)
percent
- percentpublic double getPercent(double v)
v
- valuepublic void setName(java.lang.String value)
value
- The new value for Namepublic java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object