@Override public void registerFruitFamily(IFruitFamily family) { fruitMap.put(family.getUID(), family); for (IAlleleHandler handler : this.alleleHandlers) { handler.onRegisterFruitFamily(family); } }
@Override public void registerClassification(IClassification branch) { if (classificationMap.containsKey(branch.getUID())) { throw new RuntimeException(String.format("Could not add new classification '%s', because the key is already taken by %s.", branch.getUID(), classificationMap.get(branch.getUID()))); } classificationMap.put(branch.getUID(), branch); for (IAlleleHandler handler : this.alleleHandlers) { handler.onRegisterClassification(branch); } }
@Override public void registerAllele(IAllele allele, IChromosomeType... chromosomeTypes) { addValidAlleleTypes(allele, chromosomeTypes); alleleMap.put(allele.getUID(), allele); if (allele instanceof IAlleleSpecies) { IClassification branch = ((IAlleleSpecies) allele).getBranch(); branch.addMemberSpecies((IAlleleSpecies) allele); } for (IAlleleHandler handler : this.alleleHandlers) { handler.onRegisterAllele(allele); } }