resources.add(new GridResource(decoder, name.trim(), grid, siblings)); siblings.clear();
/** * Returns the resources (features or coverages) in this netCDF store. * * @return children resources that are components of this netCDF store. * @throws DataStoreException if an error occurred while fetching the components. * * @since 0.8 */ @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public synchronized Collection<Resource> components() throws DataStoreException { if (components == null) try { Resource[] resources = decoder.getDiscreteSampling(); final List<Resource> grids = GridResource.create(decoder); if (!grids.isEmpty()) { grids.addAll(UnmodifiableArrayList.wrap(resources)); resources = grids.toArray(new Resource[grids.size()]); } components = UnmodifiableArrayList.wrap(resources); } catch (IOException e) { throw new DataStoreException(e); } return components; }
/** * Returns the ranges of sample values together with the conversion from samples to real values. */ @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public List<SampleDimension> getSampleDimensions() { SampleDimension.Builder builder = null; for (int i=0; i<ranges.length; i++) { if (ranges[i] == null) { if (builder == null) builder = new SampleDimension.Builder(); ranges[i] = createSampleDimension(builder, data[i]); builder.clear(); } } return UnmodifiableArrayList.wrap(ranges); }
range = validateRangeArgument(data.length, range); if (domain == null) { domain = gridGeometry; if (def == null) { if (builder == null) builder = new SampleDimension.Builder(); ranges[i] = def = createSampleDimension(builder, variable);