Class DefaultMedium
java.lang.Object
org.apache.sis.metadata.AbstractMetadata
org.apache.sis.metadata.ModifiableMetadata
org.apache.sis.metadata.iso.ISOMetadata
org.apache.sis.metadata.iso.distribution.DefaultMedium
- All Implemented Interfaces:
Serializable,Emptiable,LenientComparable,IdentifiedObject,org.opengis.metadata.distribution.Medium
Information about the media on which the resource can be distributed.
The following property is mandatory or conditional (i.e. mandatory under some circumstances)
in a well-formed metadata according ISO 19115:
MD_Medium
└─densityUnits…… Units of measure for the recording density.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
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.metadata.ModifiableMetadata
ModifiableMetadata.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<Double>Density at which the data is recorded.private javax.measure.Unit<?>Units of measure for the recording density.private Collection<org.opengis.metadata.distribution.MediumFormat>Methods used to write to the medium.private org.opengis.util.InternationalStringDescription of other limitations or requirements for using the medium.private org.opengis.metadata.distribution.MediumNameName of the medium on which the resource can be received.private static final longSerial number for inter-operability with different versions.private IntegerNumber of items in the media identified.Fields inherited from class org.apache.sis.metadata.iso.ISOMetadata
identifiers -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an initially empty medium.DefaultMedium(org.opengis.metadata.distribution.Medium object) Constructs a new instance initialized with the values from the specified metadata object. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultMediumcastOrCopy(org.opengis.metadata.distribution.Medium object) Returns a SIS metadata implementation with the values of the given arbitrary implementation.Deprecated.Returns the density at which the data is recorded.javax.measure.Unit<?>Returns the units of measure for the recording density.org.opengis.metadata.IdentifierReturns a unique identifier for an instance of the medium.Collection<org.opengis.metadata.distribution.MediumFormat>Returns the method used to write to the medium.org.opengis.util.InternationalStringReturns a description of other limitations or requirements for using the medium.org.opengis.metadata.distribution.MediumNamegetName()Returns the name of the medium on which the resource can be received.private org.opengis.metadata.citation.CitationReturns the medium name as a code list.Returns the number of items in the media identified.voidsetDensities(Collection<? extends Double> newValues) Deprecated.As of ISO 19115:2014, replaced bysetDensity(Double).voidsetDensity(Double newValue) Sets density at which the data is recorded.voidsetDensityUnits(javax.measure.Unit<?> newValue) Sets the units of measure for the recording density.voidsetIdentifier(org.opengis.metadata.Identifier newValue) Sets a unique identifier for an instance of the medium.voidsetMediumFormats(Collection<? extends org.opengis.metadata.distribution.MediumFormat> newValues) Sets the method used to write to the medium.voidsetMediumNote(org.opengis.util.InternationalString newValue) Sets a description of other limitations or requirements for using the medium.voidsetName(org.opengis.metadata.distribution.MediumName newValue) Sets the name of the medium on which the resource can be received.private voidsetNewName(org.opengis.metadata.citation.Citation newValue) Sets the name of the medium on which the resource can be received.voidsetVolumes(Integer newValue) Sets the number of items in the media identified.Methods inherited from class org.apache.sis.metadata.iso.ISOMetadata
getIdentifierMap, getIdentifiers, getStandard, transitionToMethods inherited from class org.apache.sis.metadata.ModifiableMetadata
checkWritePermission, collectionType, copyCollection, copyList, copyMap, copySet, deepCopy, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, writeCollection, writeList, writeMap, writeSetMethods inherited from class org.apache.sis.metadata.AbstractMetadata
asMap, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, prune, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
name
private org.opengis.metadata.distribution.MediumName nameName of the medium on which the resource can be received. -
densities
Density at which the data is recorded. If non-null, then the number shall be greater than zero. -
densityUnits
private javax.measure.Unit<?> densityUnitsUnits of measure for the recording density. -
volumes
Number of items in the media identified. -
mediumFormats
Methods used to write to the medium. -
mediumNote
private org.opengis.util.InternationalString mediumNoteDescription of other limitations or requirements for using the medium.
-
-
Constructor Details
-
DefaultMedium
public DefaultMedium()Constructs an initially empty medium. -
DefaultMedium
public DefaultMedium(org.opengis.metadata.distribution.Medium object) 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
DefaultMedium, then it is returned unchanged. - Otherwise a new
DefaultMediuminstance 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
-
getName
public org.opengis.metadata.distribution.MediumName getName()Returns the name of the medium on which the resource can be received.Upcoming API change
MediumNamemay be replaced byCitationin GeoAPI 4.0.- Specified by:
getNamein interfaceorg.opengis.metadata.distribution.Medium- Returns:
- name of the medium, or
null. - See Also:
-
setName
public void setName(org.opengis.metadata.distribution.MediumName newValue) Sets the name of the medium on which the resource can be received.Upcoming API change
MediumNamemay be replaced byCitationin GeoAPI 4.0.- Parameters:
newValue- the new name.
-
getDensity
@ValueRange(minimum=0.0, isMinIncluded=false) @UML(identifier="density", obligation=OPTIONAL, specification=ISO_19115) public Double getDensity()Returns the density at which the data is recorded. The number shall be greater than zero.- Returns:
- density at which the data is recorded, or
null. - Since:
- 0.5
-
setDensity
Sets density at which the data is recorded. The number shall be greater than zero.- Parameters:
newValue- the new density.- Throws:
IllegalArgumentException- if the given value is NaN, zero or negative.- Since:
- 0.5
-
getDensities
Deprecated.As of ISO 19115:2014, replaced bygetDensity().- Specified by:
getDensitiesin interfaceorg.opengis.metadata.distribution.Medium- Returns:
- density at which the data is recorded, or
null.
-
setDensities
Deprecated.As of ISO 19115:2014, replaced bysetDensity(Double).- Parameters:
newValues- the new densities.
-
getDensityUnits
public javax.measure.Unit<?> getDensityUnits()Returns the units of measure for the recording density.- Specified by:
getDensityUnitsin interfaceorg.opengis.metadata.distribution.Medium- Returns:
- units of measure for the recording density, or
null.
-
setDensityUnits
public void setDensityUnits(javax.measure.Unit<?> newValue) Sets the units of measure for the recording density.- Parameters:
newValue- the new density units.
-
getVolumes
Returns the number of items in the media identified.- Specified by:
getVolumesin interfaceorg.opengis.metadata.distribution.Medium- Returns:
- number of items in the media identified, or
null.
-
setVolumes
Sets the number of items in the media identified.- Parameters:
newValue- the new volumes, ornull.- Throws:
IllegalArgumentException- if the given value is negative.
-
getMediumFormats
Returns the method used to write to the medium.- Specified by:
getMediumFormatsin interfaceorg.opengis.metadata.distribution.Medium- Returns:
- method used to write to the medium, or
null.
-
setMediumFormats
public void setMediumFormats(Collection<? extends org.opengis.metadata.distribution.MediumFormat> newValues) Sets the method used to write to the medium.- Parameters:
newValues- the new medium formats.
-
getMediumNote
public org.opengis.util.InternationalString getMediumNote()Returns a description of other limitations or requirements for using the medium.- Specified by:
getMediumNotein interfaceorg.opengis.metadata.distribution.Medium- Returns:
- description of other limitations for using the medium, or
null.
-
setMediumNote
public void setMediumNote(org.opengis.util.InternationalString newValue) Sets a description of other limitations or requirements for using the medium.- Parameters:
newValue- the new medium note.
-
getIdentifier
@UML(identifier="identifier", obligation=OPTIONAL, specification=ISO_19115) public org.opengis.metadata.Identifier getIdentifier()Returns a unique identifier for an instance of the medium.- Overrides:
getIdentifierin classISOMetadata- Returns:
- unique identifier, or
nullif none. - Since:
- 0.5
-
setIdentifier
public void setIdentifier(org.opengis.metadata.Identifier newValue) Sets a unique identifier for an instance of the medium.- Overrides:
setIdentifierin classISOMetadata- Parameters:
newValue- the new identifier.- Since:
- 0.5
-
getNewName
private org.opengis.metadata.citation.Citation getNewName()Returns the medium name as a code list. -
setNewName
private void setNewName(org.opengis.metadata.citation.Citation newValue) Sets the name of the medium on which the resource can be received.
-
getDensity().