@Override public void mapValue(Compound compound, String string){ string = filter(string); if(string == null){ return; } this.references.put(compound.getId(), string); }
@Override public void mapValue(Compound compound, String string){ string = filter(string); if(string == null || string.trim().length() == 0){ return; } C parameter = getParameter(); ValueFormat<V> format = getFormat(); try { this.values.put(compound.getId(), format.parse(string)); } catch(RuntimeException re){ System.err.println("Cannot parse " + parameter.getId() + " value \"" + escape(string) + "\" for " + compound.getId()); throw re; } }
private void addCompounds(Collection<Compound> compounds) { for (Compound c: compounds) { Map<Column, Cell> values = new LinkedHashMap<Column, Cell>(); addAttribute(c.getId(), ID_COLUMN, values); addAttribute(c.getName(), NAME_COLUMN, values); addAttribute(c.getCas(), CAS_COLUMN, values); addAttribute(c.getInChI(), INCHI_COLUMN, values); rows.add(new Row(c.getId(), values)); } }