public Object getObjectValue(int icol) { try { Object[] userCoords = reader_.getUserCoordValues(baseSeq_, irow_, icol); Object value = spec_.getCoord(icol).userToStorage(userCoords, mappers_[icol]); assert value != null; return value; } catch (IOException e) { logError(e); return null; } }
/** * Utility method to work out the domain mappers for a given coordinate of a DataSpec. For the * requested coord, it returns a mapper array with elements filled, in with any mapper known for * the given user coordinates that has the sub-type appropriate for that coordinate. * * @param dataSpec data specification object * @param icoord index of coordinate in <code>dataSpec</code> * @return mapper array for decoding values of one coordinate of a data spec */ public static DomainMapper[] getUserCoordMappers(DataSpec dataSpec, int icoord) { List<Class<? extends DomainMapper>> userDomains = dataSpec.getCoord(icoord).getUserDomains(); ValueInfo[] userInfos = dataSpec.getUserCoordInfos(icoord); int nu = userDomains.size(); DomainMapper[] mappers = new DomainMapper[nu]; for (int iu = 0; iu < nu; iu++) { Class reqClazz = userDomains.get(iu); if (reqClazz != null) { DomainMapper[] infoMappers = userInfos[iu].getDomainMappers(); for (int im = 0; im < infoMappers.length && mappers[iu] == null; im++) { if (reqClazz.isInstance(infoMappers[im])) { mappers[iu] = infoMappers[im]; } } } } return mappers; }