/** * Sets the units of data as a unit of length. * * <div class="warning"><b>Upcoming precondition change — relaxation</b><br> * The current implementation requires the unit to be an instance of {@code Unit<Length>}, * otherwise a {@link ClassCastException} is thrown. This is because the value returned by * {@link #getUnits()} was restricted by ISO 19115:2003 to units of length. * However this restriction may be relaxed in GeoAPI 4.0. * </div> * * @param newValue The new units of data as an instance of {@code Unit<Length>}. */ @Override public void setUnits(final Unit<?> newValue) { super.setUnits(newValue.asType(Length.class)); }
/** * Sets the units of data in the current band. * If a coverage contains more than one band, additional bands can be created by calling * {@link #newSampleDimension()} before to call this method. * Storage location is: * * <ul> * <li>{@code metadata/contentInfo/attributeGroup/attribute/unit}</li> * </ul> * * @param unit units of measurement of sample values. */ public final void setSampleUnits(final Unit<?> unit) { if (unit != null) { sampleDimension().setUnits(unit); } }
/** * Sets the units of data as a unit of length. * * <div class="warning"><b>Upcoming precondition change — relaxation</b><br> * The current implementation requires the unit to be an instance of {@code Unit<Length>}, * otherwise a {@link ClassCastException} is thrown. This is because the value returned by * {@link #getUnits()} was restricted by ISO 19115:2003 to units of length. * However this restriction may be relaxed in GeoAPI 4.0. * </div> * * @param newValue The new units of data as an instance of {@code Unit<Length>}. */ @Override public void setUnits(final Unit<?> newValue) { super.setUnits(newValue.asType(Length.class)); }
/** * Sets the units of data in the current band. * If a coverage contains more than one band, additional bands can be created by calling * {@link #newSampleDimension()} before to call this method. * Storage location is: * * <ul> * <li>{@code metadata/contentInfo/attributeGroup/attribute/unit}</li> * </ul> * * @param unit units of measurement of sample values. */ public final void setSampleUnits(final Unit<?> unit) { if (unit != null) { sampleDimension().setUnits(unit); } }