com.tensegrity.composite.coordinate
Class DefaultScaleLinear

java.lang.Object
  extended bycom.tensegrity.composite.coordinate.DefaultScaleLinear
All Implemented Interfaces:
Scale
Direct Known Subclasses:
DefaultMutableScaleLinear

public class DefaultScaleLinear
extends java.lang.Object
implements Scale

This is the default implementation of the Scale interface. The documentation can be found in the interface Scale.

Version:
$Id: DefaultScaleLinear.java,v 1.10 2005/09/16 11:33:49 MichaelKegel Exp $
Author:
MichaelKegel
See Also:
DefaultMutableScaleLinear, Scale

Field Summary
 
Fields inherited from interface com.tensegrity.composite.coordinate.Scale
TYPE_LINEAR
 
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)
           
 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 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
 

Method Detail

getScaleMinimum

public double getScaleMinimum()
Description copied from interface: Scale
Returns the minimum scale value for this Scale.

Specified by:
getScaleMinimum in interface Scale
Returns:
double the minimum scale value

getScaleMaximum

public double getScaleMaximum()
Description copied from interface: Scale
Returns the maximum scale value for this Scale.

Specified by:
getScaleMaximum in interface Scale
Returns:
double the maximum scale value

getScaleRange

public double getScaleRange()
Description copied from interface: Scale
Returns the scale range for this Scale. The scale range is defined as the interval between the minimum scale value and the maximum scale value. The mathematical expression for this is:
maximum scale value - minimum scale value.

Specified by:
getScaleRange in interface Scale
Returns:
double the scale range

getScaleFactor

public double getScaleFactor(double minimum,
                             double maximum)
Description copied from interface: Scale
Returns the scale factor that converts a value from the range of this Scale to the range given by minimum and maximum. The mathematical expression for this is:
(maximum - minimum) / (maximum scale value - minimum scale value) .

Specified by:
getScaleFactor in interface Scale
Parameters:
minimum - the minimum value of the range to convert to
maximum - the maximum value of the range to convert to
Returns:
double the scale factor

getDescaleFactor

public double getDescaleFactor(double minimum,
                               double maximum)
Description copied from interface: Scale
Returns the scale factor that converts a value from the range given by minimum and maximum to range of this Scale. The mathematical expression for this is:
(maximum scale value - minimum scale value) / (maximum - minimum) .

Specified by:
getDescaleFactor in interface Scale
Parameters:
minimum - the minimum value of the range to convert from
maximum - the maximum value of the range to convert from
Returns:
double the descale factor

scale

public double scale(double minimum,
                    double maximum,
                    double valueToScale)
Description copied from interface: Scale
Converts the value given by valueToScale 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) .

Specified by:
scale in interface Scale
Parameters:
minimum - the minimum value of the range to convert to
maximum - the maximum value of the range to convert to
valueToScale - the value to convert
Returns:
double the converted value

descale

public double descale(double minimum,
                      double maximum,
                      double valueToDescale)
Description copied from interface: Scale
Converts the value given by valueToDescale 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) .

Specified by:
descale in interface Scale
Parameters:
minimum - the minimum value of the range to convert from
maximum - the maximum value of the range to convert from
valueToDescale - the value to convert
Returns:
double the converted value

deepCopy

public Scale deepCopy()
Description copied from interface: Scale
Method to deep copy this scale instance.

Specified by:
deepCopy in interface Scale
Returns:
the copied Scale.

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.