Class DefaultBand
- All Implemented Interfaces:
Serializable, Emptiable, LenientComparable, IdentifiedObject, Band, RangeDimension
Range of wavelengths in the electromagnetic spectrum.
The following property is conditional (i.e. mandatory under some circumstances)
in a well-formed metadata according ISO 19115:
MD_Band
└─units…… Units of data in each dimension included in the resource.Limitations
- Instances of this class are not synchronized for multi-threading. Synchronization, if needed, is caller's responsibility.
- Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
Serialization support is appropriate for short term storage or RMI between applications running the
same version of Apache SIS. For long term storage, use
XMLinstead.
- Since:
- 0.3
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ModifiableMetadata
ModifiableMetadata.StateModifier and TypeClassDescriptionstatic enumWhether the metadata is still editable or has been made final. -
Field Summary
Fields inherited from class ISOMetadata
identifiersModifier and TypeFieldDescriptionprotected Collection<Identifier> All identifiers associated with this metadata, ornullif none. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an initially empty band.DefaultBand(Band object) Constructs a new instance initialized with the values from the specified metadata object. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultBandcastOrCopy(Band object) Returns a SIS metadata implementation with the values of the given arbitrary implementation.Returns the designation of criterion for defining maximum and minimum wavelengths for a spectral band.Returns the longest wavelength that the sensor is capable of collecting within a designated band.Returns the shortest wavelength that the sensor is capable of collecting within a designated band.Returns units in which sensor wavelengths are expressed.Returns polarization of the radiation detected.Returns the smallest distance between which separate points can be distinguished, as specified in instrument design.Returns the wavelength at which the response is the highest.Returns the number of discrete numerical values in the grid data.Returns type of transfer function to be used when scaling a physical value for a given element.Returns the polarization of the radiation transmitted.Returns the units of data as a unit of length.voidsetBandBoundaryDefinition(BandDefinition newValue) Sets designation of criterion for defining maximum and minimum wavelengths for a spectral band.voidsetBoundMax(Double newValue) Sets the longest wavelength that the sensor is capable of collecting within a designated band.voidsetBoundMin(Double newValue) Sets the shortest wavelength that the sensor is capable of collecting within a designated band.voidsetBoundUnits(Unit<Length> newValue) Sets a new units in which sensor wavelengths are expressed.voidSets the polarization of the radiation detected.voidsetNominalSpatialResolution(Double newValue) Sets the smallest distance between which separate points can be distinguished, as specified in instrument design.voidsetPeakResponse(Double newValue) Sets the wavelength at which the response is the highest.voidsetToneGradation(Integer newValue) Sets the number of discrete numerical values in the grid data.voidsetTransferFunctionType(TransferFunctionType newValue) Sets the type of transfer function to be used when scaling a physical value for a given element.voidSets the polarization of the radiation transmitted.voidSets the units of data as a unit of length.Methods inherited from class DefaultSampleDimension
getBitsPerValue, getMaxValue, getMeanValue, getMinValue, getNumberOfValues, getOffset, getOtherProperty, getOtherPropertyType, getRangeElementDescriptions, getScaleFactor, getStandardDeviation, setBitsPerValue, setMaxValue, setMeanValue, setMinValue, setNumberOfValues, setOffset, setOtherProperty, setOtherPropertyType, setRangeElementDescriptions, setScaleFactor, setStandardDeviationModifier and TypeMethodDescriptionReturns the maximum number of significant bits in the uncompressed representation for the value in each band of each pixel.Returns the maximum value of data values in each dimension included in the resource.Returns the mean value of data values in each dimension included in the resource.Returns the minimum value of data values in each dimension included in the resource.Returns the number of values used in a thematic classification resource.Returns the physical value corresponding to a cell value of zero.Returns instance of other/attributeType that defines attributes not explicitly included inCoverageContentType, ornullif none.Returns type of other attribute description.Provides the description and values of the specific range elements of a sample dimension.Returns the scale factor which has been applied to the cell value.Returns the standard deviation of data values in each dimension included in the resource.voidsetBitsPerValue(Integer newValue) Sets the maximum number of significant bits in the uncompressed representation for the value in each band of each pixel.voidsetMaxValue(Double newValue) Sets the maximum value of data values in each dimension included in the resource.voidsetMeanValue(Double newValue) Sets the mean value of data values in each dimension included in the resource.voidsetMinValue(Double newValue) Sets the minimum value of data values in each dimension included in the resource.voidsetNumberOfValues(Integer newValue) Sets the number of values used in a thematic classification resource.voidsetOffset(Double newValue) Sets the physical value corresponding to a cell value of zero.voidsetOtherProperty(Record newValue) Sets a new instance of other/attributeType that defines attributes not explicitly included inCoverageContentType.voidsetOtherPropertyType(RecordType newValue) Sets a new type of other attribute description.voidsetRangeElementDescriptions(Collection<? extends RangeElementDescription> newValues) Sets the description and values of the specific range elements of a sample dimension.voidsetScaleFactor(Double newValue) Sets the scale factor which has been applied to the cell value.voidsetStandardDeviation(Double newValue) Sets the standard deviation of data values in each dimension included in the resource.Methods inherited from class DefaultRangeDimension
castOrCopy, getDescription, getDescriptor, getNames, getSequenceIdentifier, setDescription, setDescriptor, setNames, setSequenceIdentifierModifier and TypeMethodDescriptionstatic DefaultRangeDimensioncastOrCopy(RangeDimension object) Returns a SIS metadata implementation with the values of the given arbitrary implementation.Returns the description of the attribute.Deprecated.Returns the identifiers for each attribute included in the resource.Returns a unique name or number that identifies attributes included in the coverage.voidsetDescription(InternationalString newValue) Sets the description of the attribute.voidsetDescriptor(InternationalString newValue) Deprecated.As of ISO 19115:2014, renamedDefaultRangeDimension.setDescription(InternationalString).voidsetNames(Collection<? extends Identifier> newValues) Sets the identifiers for each attribute included in the resource.voidsetSequenceIdentifier(MemberName newValue) Sets the name or number that uniquely identifies instances of bands of wavelengths on which a sensor operates.Methods inherited from class ISOMetadata
getIdentifier, getIdentifierMap, getIdentifiers, getStandard, setIdentifierModifier and TypeMethodDescriptionprotected IdentifierReturns the first identifier which is presumed to be defined by ISO 19115 conceptual model.A map view of the identifiers collection as (authority, code) entries.Returns all identifiers associated with this object (from conceptual model and from XML document).Returns the metadata standard implemented by subclasses, which is ISO 19115.protected voidsetIdentifier(Identifier newValue) Sets the identifier for metadata objects that are expected to contain at most one ISO 19115 identifier.Methods inherited from class ModifiableMetadata
checkWritePermission, copyCollection, copyList, copyMap, copySet, deepCopy, merge, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, writeCollection, writeList, writeMap, writeSetModifier and TypeMethodDescriptionprotected voidcheckWritePermission(Object current) Checks if changes in the metadata are allowed.protected static <E> Collection<E> copyCollection(Collection<? extends E> source, Class<E> elementType) Creates a list or set with the content of thesourcecollection, or returnsnullif the source isnullor empty.protected static <E> List<E> copyList(Collection<? extends E> source, Class<E> elementType) Creates a list with the content of thesourcecollection, or returnsnullif the source isnullor empty.protected static <K,V> Map <K, V> Creates a map with the content of thesourcemap, or returnsnullif the source isnullor empty.protected static <E> Set<E> copySet(Collection<? extends E> source, Class<E> elementType) Creates a set with the content of thesourcecollection, or returnsnullif the source isnullor empty.deepCopy(ModifiableMetadata.State target) Copies (if necessary) this metadata and all its children.voidMerges the data from the given source into this metadata.protected final <E> Collection<E> nonNullCollection(Collection<E> current, Class<E> elementType) Returns the specified collection, or a new one ifcurrentis null.protected final <E> List<E> nonNullList(List<E> current, Class<E> elementType) Returns the specified list, or a new one ifcurrentis null.protected final <K,V> Map <K, V> nonNullMap(Map<K, V> current, Class<K> keyType) Returns the specified map, or a new one ifcurrentis null.protected final <E> Set<E> nonNullSet(Set<E> current, Class<E> elementType) Returns the specified set, or a new one ifcurrentis null.protected static <E> Collection<E> Creates a singleton list or set containing only the given value, if non-null.state()Tells whether this instance of metadata is editable.protected final <E> Collection<E> writeCollection(Collection<? extends E> source, Collection<E> target, Class<E> elementType) Writes the content of thesourcecollection into thetargetlist or set, creating it if needed.protected final <E> List<E> writeList(Collection<? extends E> source, List<E> target, Class<E> elementType) Writes the content of thesourcecollection into thetargetlist, creating it if needed.protected final <K,V> Map <K, V> Writes the content of thesourcemap into thetargetmap, creating it if needed.protected final <E> Set<E> writeSet(Collection<? extends E> source, Set<E> target, Class<E> elementType) Writes the content of thesourcecollection into thetargetset, creating it if needed.Methods inherited from class AbstractMetadata
asMap, asTreeTable, clone, equals, equals, getInterface, getStandardType, hashCode, isEmpty, nilReasons, prune, toStringModifier and TypeMethodDescriptionasMap()Returns a view of the property values in aMap.Returns the property types and values as a tree table.protected AbstractMetadataclone()Returns a shallow clone of this metadata.final booleanPerforms a strict comparison of this metadata with the given object.booleanequals(Object object, ComparisonMode mode) Compares this metadata with the specified object for equality.final Class<?> Deprecated, for removal: This API element is subject to removal in a future version.RenamedAbstractMetadata.getStandardType()for integration withLenientComparable.Returns the metadata interface implemented by this class.intComputes a hash code value for this metadata using Java reflection.booleanisEmpty()Returns a view of the reasons why some properties are missing.voidprune()Removes all references to empty properties.Returns a string representation of this metadata.Methods inherited from interface Band
getBitsPerValue, getMaxValue, getMinValue, getOffset, getScaleFactorModifier and TypeMethodDescriptionMaximum number of significant bits in the uncompressed representation for the value in each band of each pixel.Longest wavelength that the sensor is capable of collecting within a designated band.Shortest wavelength that the sensor is capable of collecting within a designated band.The physical value corresponding to a cell value of zero.Scale factor which has been applied to the cell value.
-
Constructor Details
-
DefaultBand
public DefaultBand()Constructs an initially empty band. -
DefaultBand
Constructs a new instance initialized with the values from the specified metadata object. This is a shallow copy constructor, because the other metadata contained in the given object are not recursively copied.Note on properties validation
This constructor does not verify the property values of the given metadata (e.g. whether it contains unexpected negative values). This is because invalid metadata exist in practice, and verifying their validity in this copy constructor is often too late. Note that this is not the only hole, as invalid metadata instances can also be obtained by unmarshalling an invalid XML document.- Parameters:
object- the metadata to copy values from, ornullif none.- See Also:
-
-
Method Details
-
castOrCopy
Returns a SIS metadata implementation with the values of the given arbitrary implementation. This method performs the first applicable action in the following choices:- If the given object is
null, then this method returnsnull. - Otherwise if the given object is already an instance of
DefaultBand, then it is returned unchanged. - Otherwise a new
DefaultBandinstance is created using the copy constructor and returned. Note that this is a shallow copy operation, because the other metadata contained in the given object are not recursively copied.
- Parameters:
object- the object to get as a SIS implementation, ornullif none.- Returns:
- a SIS implementation containing the values of the given object (may be the
given object itself), or
nullif the argument was null.
- If the given object is
-
getBoundMin
@ValueRange(minimum=0.0) @UML(identifier="boundMin", obligation=OPTIONAL, specification=ISO_19115) public Double getBoundMin()Returns the shortest wavelength that the sensor is capable of collecting within a designated band. The units of measurement is given bygetBoundUnits().- Returns:
- Shortest wavelength that the sensor is capable of collecting within a designated band,
or
nullif unspecified. - Since:
- 0.5
-
setBoundMin
Sets the shortest wavelength that the sensor is capable of collecting within a designated band.- Parameters:
newValue- the new shortest wavelength, ornull.- Throws:
IllegalArgumentException- if the given value is negative.- Since:
- 0.5
-
getBoundMax
@ValueRange(minimum=0.0) @UML(identifier="boundMax", obligation=OPTIONAL, specification=ISO_19115) public Double getBoundMax()Returns the longest wavelength that the sensor is capable of collecting within a designated band. The units of measurement is given bygetUnits().- Returns:
- longest wavelength that the sensor is capable of collecting within a designated band,
or
nullif unspecified. - Since:
- 0.5
-
setBoundMax
Sets the longest wavelength that the sensor is capable of collecting within a designated band.- Parameters:
newValue- the new longest wavelength, ornull.- Throws:
IllegalArgumentException- if the given value is negative.- Since:
- 0.5
-
getBoundUnits
@UML(identifier="boundUnits", obligation=OPTIONAL, specification=ISO_19115) public Unit<Length> getBoundUnits()Returns units in which sensor wavelengths are expressed.- Returns:
- units in which sensor wavelengths are expressed.
- Since:
- 0.5
- See Also:
-
setBoundUnits
-
getBandBoundaryDefinition
Returns the designation of criterion for defining maximum and minimum wavelengths for a spectral band.- Specified by:
getBandBoundaryDefinitionin interfaceBand- Returns:
- criterion for defining maximum and minimum wavelengths, or
null.
-
setBandBoundaryDefinition
Sets designation of criterion for defining maximum and minimum wavelengths for a spectral band.- Parameters:
newValue- the new band definition.
-
getUnits
Returns the units of data as a unit of length.Upcoming API change — generalization
As of ISO 19115:2014, the units of wavelength is ratherboundUnits. The restriction for units of length in thisunitsproperty may be relaxed in GeoAPI 4.0.- Specified by:
getUnitsin interfaceBand- Overrides:
getUnitsin classDefaultSampleDimension- Returns:
- The units of data.
-
setUnits
Sets the units of data as a unit of length.Upcoming precondition change — relaxation
The current implementation requires the unit to be an instance ofUnit<Length>, otherwise aClassCastExceptionis thrown. This is because the value returned bygetUnits()was restricted by ISO 19115:2003 to units of length. However this restriction may be relaxed in GeoAPI 4.0.- Overrides:
setUnitsin classDefaultSampleDimension- Parameters:
newValue- The new units of data as an instance ofUnit<Length>.
-
getPeakResponse
Returns the wavelength at which the response is the highest. The units of measurement is given bygetBoundUnits().- Specified by:
getPeakResponsein interfaceBand- Returns:
- wavelength at which the response is the highest, or
nullif unspecified.
-
setPeakResponse
Sets the wavelength at which the response is the highest.- Parameters:
newValue- the new peak response, ornull.- Throws:
IllegalArgumentException- if the given value is negative.
-
getToneGradation
Returns the number of discrete numerical values in the grid data.- Specified by:
getToneGradationin interfaceBand- Returns:
- number of discrete numerical values in the grid data, or
nullif none.
-
setToneGradation
Sets the number of discrete numerical values in the grid data.- Parameters:
newValue- the new tone gradation.
-
getNominalSpatialResolution
Returns the smallest distance between which separate points can be distinguished, as specified in instrument design.- Specified by:
getNominalSpatialResolutionin interfaceBand- Overrides:
getNominalSpatialResolutionin classDefaultSampleDimension- Returns:
- smallest distance between which separate points can be distinguished, or
null.
-
setNominalSpatialResolution
Sets the smallest distance between which separate points can be distinguished, as specified in instrument design.- Overrides:
setNominalSpatialResolutionin classDefaultSampleDimension- Parameters:
newValue- the new nominal spatial resolution.
-
getTransferFunctionType
Returns type of transfer function to be used when scaling a physical value for a given element.- Specified by:
getTransferFunctionTypein interfaceBand- Overrides:
getTransferFunctionTypein classDefaultSampleDimension- Returns:
- type of transfer function, or
null.
-
setTransferFunctionType
Sets the type of transfer function to be used when scaling a physical value for a given element.- Overrides:
setTransferFunctionTypein classDefaultSampleDimension- Parameters:
newValue- the new transfer function value.
-
getTransmittedPolarization
Returns the polarization of the radiation transmitted.Upcoming API change
This method may be renamedgetTransmittedPolarizationand its return type replaced byPolarisationOrientation("z" letter replaced by "s" letter) in GeoAPI 4.0 for compliance with ISO 19115-2:2019.- Specified by:
getTransmittedPolarizationin interfaceBand- Returns:
- polarization of the radiation transmitted, or
null.
-
setTransmittedPolarization
Sets the polarization of the radiation transmitted.Upcoming API change
This method may be renamedsetTransmittedPolarizationand its argument type replaced byPolarisationOrientation("z" letter replaced by "s" letter) in GeoAPI 4.0 for compliance with ISO 19115-2:2019.- Parameters:
newValue- the new transmitted polarization.
-
getDetectedPolarization
Returns polarization of the radiation detected.Upcoming API change
This method may be renamedgetDetectedPolarizationand its return type replaced byPolarisationOrientation("z" letter replaced by "s" letter) in GeoAPI 4.0 for compliance with ISO 19115-2:2019.- Specified by:
getDetectedPolarizationin interfaceBand- Returns:
- polarization of the radiation detected, or
null.
-
setDetectedPolarization
Sets the polarization of the radiation detected.Upcoming API change
This method may be renamedsetDetectedPolarizationand its argument type replaced byPolarisationOrientation("z" letter replaced by "s" letter) in GeoAPI 4.0 for compliance with ISO 19115-2:2019.- Parameters:
newValue- the new detected polarization.
-
DefaultRangeDimension.getDescription().