/** * Sets the type of information represented by the cell value. * This method stores the value in the first writable {@linkplain #getAttributeGroups() attribute groups}. * * @param newValue the new content type. * * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setContentTypes(Collection)}. */ @Deprecated public void setContentType(final CoverageContentType newValue) { checkWritePermission(); final Collection<CoverageContentType> newValues = LegacyPropertyAdapter.asCollection(newValue); Collection<DefaultAttributeGroup> groups = attributeGroups; if (groups != null) { for (final DefaultAttributeGroup group : groups) { group.setContentTypes(newValues); return; // Actually stop at the first instance. } } final DefaultAttributeGroup group = new DefaultAttributeGroup(); group.setContentTypes(newValues); if (groups != null) { groups.add(group); } else { groups = Collections.<DefaultAttributeGroup>singleton(group); } setAttributeGroups(groups); }
/** * Sets the type of information represented by the cell value. * This method stores the value in the first writable {@linkplain #getAttributeGroups() attribute groups}. * * @param newValue the new content type. * * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setContentTypes(Collection)}. */ @Deprecated public void setContentType(final CoverageContentType newValue) { checkWritePermission(valueIfDefined(attributeGroups)); final Collection<CoverageContentType> newValues = LegacyPropertyAdapter.asCollection(newValue); Collection<DefaultAttributeGroup> groups = attributeGroups; if (groups != null) { for (final DefaultAttributeGroup group : groups) { group.setContentTypes(newValues); return; // Actually stop at the first instance. } } final DefaultAttributeGroup group = new DefaultAttributeGroup(); group.setContentTypes(newValues); if (groups != null) { groups.add(group); } else { groups = Collections.<DefaultAttributeGroup>singleton(group); } setAttributeGroups(groups); }