AverageWs averageWs = itaod.next();
AverageByDecade averageByDecade = averageWs.isSex()
? new AverageByDecadeMale(averageWs.getDecade())
: new AverageByDecadeFemale(averageWs.getDecade());
averageByDecade.setSamples(averageWs.getSamples());
Average averageIAR = new Average();
averageIAR.setAvg(averageWs.getIarAvg());
averageIAR.setTrustInterval(averageWs.getIarTrustInterval());
averageByDecade.setAverageIAR(averageIAR);
Average averageAOD = new Average();
averageAOD.setAvg(averageWs.getAodAvg());
averageAOD.setTrustInterval(averageWs.getAodTrustInterval());
averageByDecade.setAverageAOD(averageAOD);
Average averageAOS = new Average();
averageAOS.setAvg(averageWs.getAosAvg());
averageAOS.setTrustInterval(averageWs.getAosTrustInterval());
averageByDecade.setAverageAOS(averageAOS);
FacadeDB.getInstance().getAveragesBroker().save(averageByDecade);
}
}