private Double __calculateDistance(double theFirstShift, double theSecondShift) {
return Math.abs(theFirstShift - theSecondShift);
}
private Nmr2dCHUnit __calculateMedianPosition(Nmr2dCHUnitList thePeakList) {
Nmr2dCHUnit theMedianPosition = new Nmr2dCHUnit();
double theSumOfCarbonShift = 0;
double theSumOfHydrogenShift = 0;
int theSizeOfPeakList = thePeakList.size();
for (Nmr2dCHUnit thePeak : thePeakList.toList()) {
theSumOfCarbonShift += thePeak.getCarbonShift();
theSumOfHydrogenShift += thePeak.getHydrogenShift();
}
theMedianPosition.setCarbonShift(theSumOfCarbonShift / (double) theSizeOfPeakList);
theMedianPosition.setHydrogenShift(theSumOfHydrogenShift / (double) theSizeOfPeakList);
return theMedianPosition;
}