public DensityMapper(String name1, String name2, int numBins, Properties sbiProperties,
Function<BaseInformationRecords.BaseInformationOrBuilder, List<BaseInformationRecords.NumberWithFrequency>> recordToValues,
Function<Integer, Float> valueFunction
) {
if (!propertiesPresent(sbiProperties, "stats." + name1)) {
throw new UnsupportedOperationException("The sbip file does not contain the statistics for " + name1 + " (stats." + name1 + ".min and stats." + name1 + ".max)");
}
if (!propertiesPresent(sbiProperties, "stats." + name2)) {
throw new UnsupportedOperationException("The sbip file does not contain the statistics for " + name2 + " (stats." + name2 + ".min and stats." + name2 + ".max)");
}
this.minValue = Math.min((int)getMin(sbiProperties, "stats." + name1),(int)getMin(sbiProperties, "stats." + name2));
this.maxValue = Math.max((int)getMax(sbiProperties, "stats." + name1),(int)getMax(sbiProperties, "stats." + name2));
StringBuffer common = new StringBuffer(name1);
int i = 0;
for (i = 0; i < Math.min(name1.length(),name2.length()); i++){
if (!(name1.charAt(i) == name2.charAt(i))){
break;
}
}
common.append("+" + name2.substring(i));
constructorHelper(common.toString(),numBins,recordToValues,valueFunction);
}