All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.heigit.ohsome.oshdb.api.generic.WeightedValue Maven / Gradle / Ivy

Go to download

API to query the OpenStreetMap History Database. Includes MapReduce functionality to filter, analyze and aggregate data.

The newest version!
package org.heigit.ohsome.oshdb.api.generic;

/**
 * Immutable object that stores a numeric value and an associated weight.
 * Used to specify data input for the calculation of weighted averages.
 */
public class WeightedValue {
  private final Number value;
  private final double weight;

  public WeightedValue(Number value, double weight) {
    this.value = value;
    this.weight = weight;
  }

  /**
   * Returns the stored numeric value.
   *
   * @return the stored numeric value
   */
  public Number getValue() {
    return value;
  }

  /**
   * Returns the stored weight.
   *
   * @return the value's associated weight
   */
  public double getWeight() {
    return weight;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy