|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.coordinate.DefaultCategoryScale
This class is the default implementation of a CategoryScale. For
the documentation have a look at the CategoryScale interface.
| Field Summary | |
protected java.util.List |
categories
category range definitions |
| Fields inherited from interface com.tensegrity.composite.coordinate.Scale |
TYPE_LINEAR |
| Constructor Summary | |
DefaultCategoryScale(double scaleMinimum,
double scaleMaximum)
Constructor specifying the minimum and maximum value for the used Scale. |
|
| Method Summary | |
Scale |
deepCopy()
Method to deep copy this scale instance. |
double |
descale(double minimum,
double maximum,
double valueToDescale)
Converts the value given by valueToDescale from the range
given by minimum and maximum to the range of
this Scale. |
boolean |
equals(java.lang.Object obj)
|
java.util.List |
getCategories()
Returns a List with the CategoryRanges the
CategoryScale provides. |
double |
getDescaleFactor(double minimum,
double maximum)
Returns the scale factor that converts a value from the range given by minimum and maximum to range of this
Scale. |
double |
getScaleFactor(double minimum,
double maximum)
Returns the scale factor that converts a value from the range of this Scale to the range given by minimum and
maximum. |
double |
getScaleMaximum()
Returns the maximum scale value for this Scale. |
double |
getScaleMinimum()
Returns the minimum scale value for this Scale. |
double |
getScaleRange()
Returns the scale range for this Scale. |
int |
getWidth(int cat)
Returns the width of the category at index cat. |
int |
getWidth(int from,
int to)
Returns the single width of the category range at the given index. |
int |
getWidthSum(int to)
Returns the sum of all category ranges from the left side of the given index to. |
int |
hashCode()
|
double |
scale(double minimum,
double maximum,
double valueToScale)
Converts the value given by valueToScale from the range of
this Scale to the range given by minimum and
maximum. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.List categories
| Constructor Detail |
public DefaultCategoryScale(double scaleMinimum,
double scaleMaximum)
Scale.
scaleMinimum - the minimum of the used Scale.scaleMaximum - the maximum of the used Scale.| Method Detail |
public java.util.List getCategories()
CategoryScaleList with the CategoryRanges the
CategoryScale provides.
getCategories in interface CategoryScaleCategoryRangespublic int getWidthSum(int to)
CategoryScaleto.
getWidthSum in interface CategoryScaleto - the index up to set the sum should be builded.
to.public int getWidth(int cat)
CategoryScalecat.
getWidth in interface CategoryScalecat - the index of the CategoryRange to query.
CategoryRange at the given index.
public int getWidth(int from,
int to)
CategoryScale
getWidth in interface CategoryScalefrom - the start index.to - the stop index.
public double getScaleMinimum()
ScaleScale.
getScaleMinimum in interface Scalepublic double getScaleMaximum()
ScaleScale.
getScaleMaximum in interface Scalepublic double getScaleRange()
ScaleScale. The scale range is
defined as the interval between the minimum scale value and the maximum
scale value. The mathematical expression for this is:
getScaleRange in interface Scale
public double getScaleFactor(double minimum,
double maximum)
ScaleScale to the range given by minimum and
maximum. The mathematical expression for this is:maximum - minimum) /
(maximum scale value - minimum scale value)
.
getScaleFactor in interface Scaleminimum - the minimum value of the range to convert tomaximum - the maximum value of the range to convert to
public double getDescaleFactor(double minimum,
double maximum)
Scaleminimum and maximum to range of this
Scale. The mathematical expression for this is:maximum - minimum)
.
getDescaleFactor in interface Scaleminimum - the minimum value of the range to convert frommaximum - the maximum value of the range to convert from
public double scale(double minimum,
double maximum,
double valueToScale)
ScalevalueToScale from the range of
this Scale to the range given by minimum and
maximum. The mathematical expression for this is:valueToScale *
(maximum - minimum) /
(maximum scale value - minimum scale value)
.
scale in interface Scaleminimum - the minimum value of the range to convert tomaximum - the maximum value of the range to convert tovalueToScale - the value to convert
public double descale(double minimum,
double maximum,
double valueToDescale)
ScalevalueToDescale from the range
given by minimum and maximum to the range of
this Scale. The mathematical expression for this is:valueToScale *
(maximum scale value - minimum scale value) /
(maximum - minimum)
.
descale in interface Scaleminimum - the minimum value of the range to convert frommaximum - the maximum value of the range to convert fromvalueToDescale - the value to convert
public Scale deepCopy()
Scale
deepCopy in interface ScaleScale.public java.lang.String toString()
Object.toString()public boolean equals(java.lang.Object obj)
public int hashCode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||