org.openjump.core.attributeoperations.statistics
Class PunktScaler

java.lang.Object
  extended by org.openjump.core.attributeoperations.statistics.PunktScaler
All Implemented Interfaces:
ScaleChanger

public class PunktScaler
extends java.lang.Object
implements ScaleChanger

class to scale the "coordinates" of a punkt object, often needed for statistical calculations. Scales the given "coordinates" to values between 0 and 1.

Author:
Ole Rahn, FH Osnabrück - University of Applied Sciences Osnabrück, Project: PIROL (2005), Subproject: Daten- und Wissensmanagement
See Also:
modified: [sstein]: 16.Feb.2009 changed logger-entries to comments

Field Summary
protected  int dimension
           
protected  double[] mins
           
protected  double[] ranges
           
 
Constructor Summary
PunktScaler(int dimension, double[] mins, double[] ranges)
           
PunktScaler(PirolPoint[] punktArray)
           
 
Method Summary
protected  void getValuesFromArray(PirolPoint[] array)
           
 double scale(double value, int dimension)
           
 double unScale(double value, int dimension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dimension

protected int dimension

mins

protected double[] mins

ranges

protected double[] ranges
Constructor Detail

PunktScaler

public PunktScaler(int dimension,
                   double[] mins,
                   double[] ranges)

PunktScaler

public PunktScaler(PirolPoint[] punktArray)
Method Detail

getValuesFromArray

protected void getValuesFromArray(PirolPoint[] array)
                           throws java.lang.Exception
Throws:
java.lang.Exception

scale

public double scale(double value,
                    int dimension)
Specified by:
scale in interface ScaleChanger

unScale

public double unScale(double value,
                      int dimension)
Specified by:
unScale in interface ScaleChanger