org.heigit.ohsome.oshdb.api.generic.WeightedValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oshdb-api Show documentation
Show all versions of oshdb-api Show documentation
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