Module omix.api

Class ScalingDataMap

java.lang.Object
omix.util.math.ScalingDataMap

public class ScalingDataMap
extends Object
This class allows to scale a set of real numbers into a certain range. The single values are identifiable by a textual identifier and an index.
Author:
Dr. Peter Droste, Omix Visualization
  • Constructor Summary

    Constructors 
    Constructor Description
    ScalingDataMap​(double rangeMin, double rangeMax)
    Giving the range (in min and max value) of the resulting data.
  • Method Summary

    Modifier and Type Method Description
    double get​(String key, int index)
    Reads a data from the map identifiable by the given key and index.
    void put​(String key, int index, double value)
    Put a value into the map identified by a textual key and an index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScalingDataMap

      public ScalingDataMap​(double rangeMin, double rangeMax)
      Giving the range (in min and max value) of the resulting data. All values put into the map are scaled between the minimum and maximum value.
      Parameters:
      rangeMin - minimum value
      rangeMax - maximum value
  • Method Details

    • put

      public void put​(String key, int index, double value)
      Put a value into the map identified by a textual key and an index. One key/index combination must not be used twice otherwise, the method returns without changes.
      Parameters:
      key - textual identifier of the value.
      index - index of the value.
      value - the real number data.
    • get

      public double get​(String key, int index)
      Reads a data from the map identifiable by the given key and index.
      Parameters:
      key - textual identifier of the value.
      index - index of the value.
      Returns:
      scaled value or NaN if key does not exist in the map.