/** {@inheritDoc} */ public Set getNames(String nameClass) throws IllegalArgumentException { if (nameClass == null) throw new IllegalArgumentException("Name class cannot be null"); Set items = (Set) this.namesMap.get(nameClass); Set n = new TreeSet(); if (items != null) for (Iterator j = items.iterator(); j.hasNext(); ) { SimpleNCBITaxonName name = (SimpleNCBITaxonName) j.next(); n.add(name.getName()); } return n; }
// Hibernate requirement - not for public use. void setNameSet(Set names) { this.names = names; // original for Hibernate // convert set to map this.namesMap.clear(); for (Iterator i = names.iterator(); i.hasNext(); ) { SimpleNCBITaxonName n = (SimpleNCBITaxonName) i.next(); try { this.addName(n.getNameClass(), n.getName()); } catch (ChangeVetoException e) { throw new RuntimeException("Database contents don't add up", e); } } }