/** * Creates the attribute group object if it does not already exists, then returns it. * * @return the attribute group (never {@code null}). */ private DefaultAttributeGroup attributeGroup() { if (attributeGroup == null) { attributeGroup = new DefaultAttributeGroup(); } return attributeGroup; }
/** * Creates the attribute group object if it does not already exists, then returns it. * * @return the attribute group (never {@code null}). */ private DefaultAttributeGroup attributeGroup() { if (attributeGroup == null) { attributeGroup = new DefaultAttributeGroup(); } return attributeGroup; }
/** Stores a legacy value into the new kind of value. */ @Override protected DefaultAttributeGroup wrap(final RangeDimension value) { final DefaultAttributeGroup container = new DefaultAttributeGroup(); container.setAttributes(asCollection(value)); return container; }
/** Stores a legacy value into the new kind of value. */ @Override protected DefaultAttributeGroup wrap(final RangeDimension value) { final DefaultAttributeGroup container = new DefaultAttributeGroup(); container.setAttributes(asCollection(value)); return container; }
final DefaultAttributeGroup container = new DefaultAttributeGroup(); container.setAttributes(asCollection(value)); return container;
/** * 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); }
final DefaultAttributeGroup container = new DefaultAttributeGroup(); container.setAttributes(asCollection(value)); return container;
/** * 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); }
/** * Tests the formatting of a {@link DefaultImageDescription} object. */ @Test public void testImageDescription() { final DefaultImageDescription image = new DefaultImageDescription(); image.setAttributeGroups(Arrays.asList( new DefaultAttributeGroup(null, createBand(0.25, 0.26)), new DefaultAttributeGroup(null, createBand(0.28, 0.29)) )); final String text = format.format(image.asTreeTable()); assertMultilinesEquals( "Image description\n" + " ├─Attribute group (1 of 2)\n" + " │ └─Attribute\n" + " │ ├─Max value………………… 0.26\n" + " │ ├─Min value………………… 0.25\n" + " │ └─Units…………………………… centimetre\n" + " └─Attribute group (2 of 2)\n" + " └─Attribute\n" + " ├─Max value………………… 0.29\n" + " ├─Min value………………… 0.28\n" + " └─Units…………………………… centimetre\n", text); }
DefaultAttributeGroup group = groups[gi]; if (group == null) { group = new DefaultAttributeGroup(CoverageContentType.PHYSICAL_MEASUREMENT, null); content.getAttributeGroups().add(group); groups[gi] = group;
DefaultAttributeGroup group = groups[gi]; if (group == null) { group = new DefaultAttributeGroup(CoverageContentType.PHYSICAL_MEASUREMENT, null); content.getAttributeGroups().add(group); groups[gi] = group;