Package org.apache.sis.metadata.iso.maintenance

# Class DefaultScope

Object
AbstractMetadata
ModifiableMetadata
ISOMetadata
DefaultScope

All Implemented Interfaces:
  `Serializable`, `Emptiable`, `LenientComparable`, `IdentifiedObject`, `Scope`

Direct Known Subclasses:
  `DefaultScope`

public class DefaultScope extends ISOMetadata implements Scope
The target resource and physical extent for which information is reported. The following properties are mandatory or conditional (i.e. mandatory under some circumstances) in a well-formed metadata according ISO 19115:
`MD_Scope` `├─level…………………………………………………` Hierarchical level of the data specified by the scope. `└─levelDescription……………………` Detailed description about the level of the data specified by the scope. `├─attributeInstances……` Attribute instances to which the information applies. `├─attributes…………………………` Attributes to which the information applies. `├─dataset…………………………………` Dataset to which the information applies. `├─featureInstances…………` Feature instances to which the information applies. `├─features………………………………` Features to which the information applies. `└─other………………………………………` Class of information that does not fall into the other categories.

## 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 `XML` instead.

Since:
  0.3
See Also:
  - Serialized Form

Defined in the `sis-metadata` module

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class ModifiableMetadata

  `ModifiableMetadata​.State`

- ## Field Summary

  ### Fields inherited from class ISOMetadata

  `identifiers`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultScope()`
  Constructs an initially empty scope.
  `DefaultScope(ScopeCode level)`
  Creates a scope initialized to the given level.
  `DefaultScope(Scope object)`
  Constructs a new instance initialized with the values from the specified metadata object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DefaultScope`
  `castOrCopy(Scope object)`
  Returns a SIS metadata implementation with the values of the given arbitrary implementation.
  `Extent`
  `getExtent()`
  Deprecated.
  As of ISO 19115:2014, replaced by `getExtents()`.
  `Collection<Extent>`
  `getExtents()`
  Returns information about the spatial, vertical and temporal extents of the resource specified by the scope.
  `ScopeCode`
  `getLevel()`
  Returns the hierarchical level of the data specified by the scope.
  `Collection<ScopeDescription>`
  `getLevelDescription()`
  Returns detailed descriptions about the level of the data specified by the scope.
  `void`
  `setExtent(Extent newValue)`
  Deprecated.
  As of ISO 19115:2014, replaced by `setExtents(Collection)`.
  `void`
  `setExtents(Collection<? extends Extent> newValues)`
  Sets information about the spatial, vertical and temporal extents of the resource specified by the scope.
  `void`
  `setLevel(ScopeCode newValue)`
  Sets the hierarchical level of the data specified by the scope.
  `void`
  `setLevelDescription(Collection<? extends ScopeDescription> newValues)`
  Sets detailed descriptions about the level of the data specified by the scope.

  ### Methods inherited from class ISOMetadata

  `getIdentifier, getIdentifierMap, getIdentifiers, getStandard, setIdentifier, transitionTo`

  ### Methods inherited from class ModifiableMetadata

  `checkWritePermission, collectionType, copyCollection, copyList, copyMap, copySet, deepCopy, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, writeCollection, writeList, writeMap, writeSet`

  ### Methods inherited from class AbstractMetadata

  `asMap, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, prune, toString`

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DefaultScope

    public DefaultScope()
    Constructs an initially empty scope.

  - ### DefaultScope

    public DefaultScope(ScopeCode level)
    Creates a scope initialized to the given level.
    Parameters:
      `level` - the hierarchical level of the data specified by the scope.

  - ### DefaultScope

    public DefaultScope(Scope object)
    Constructs a new instance initialized with the values from the specified metadata object. This is a shallow copy constructor, since the other metadata contained in the given object are not recursively copied.
    Parameters:
      `object` - the metadata to copy values from, or `null` if none.
    See Also:
      - `castOrCopy(Scope)`

- ## Method Details

  - ### castOrCopy

    public static DefaultScope castOrCopy(Scope object)
    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 returns `null`.
    - Otherwise if the given object is already an instance of `DefaultScope`, then it is returned unchanged.
    - Otherwise a new `DefaultScope` instance is created using the copy constructor and returned. Note that this is a shallow copy operation, since the other metadata contained in the given object are not recursively copied.
    Parameters:
      `object` - the object to get as a SIS implementation, or `null` if none.
    Returns:
      a SIS implementation containing the values of the given object (may be the given object itself), or `null` if the argument was null.

  - ### getLevel

    public ScopeCode getLevel()
    Returns the hierarchical level of the data specified by the scope.
    Specified by:
      `getLevel` in interface `Scope`
    Returns:
      hierarchical level of the data, or `null`.

  - ### setLevel

    public void setLevel(ScopeCode newValue)
    Sets the hierarchical level of the data specified by the scope.
    Parameters:
      `newValue` - the new level.

  - ### getExtents

    @UML(identifier="extent", obligation=OPTIONAL, specification=ISO_19115) public Collection<Extent> getExtents()
    Returns information about the spatial, vertical and temporal extents of the resource specified by the scope.
    Returns:
      information about the extent of the resource.
    Since:
      0.5

  - ### setExtents

    public void setExtents(Collection<? extends Extent> newValues)
    Sets information about the spatial, vertical and temporal extents of the resource specified by the scope.
    Parameters:
      `newValues` - New information about the extent of the resource.
    Since:
      0.5

  - ### getExtent

    @Deprecated public Extent getExtent()
    Deprecated.
    As of ISO 19115:2014, replaced by `getExtents()`.
    Information about the spatial, vertical and temporal extent of the data specified by the scope. This method fetches the value from the extents collection.
    Specified by:
      `getExtent` in interface `Scope`
    Returns:
      Information about the extent of the data, or `null`.

  - ### setExtent

    @Deprecated public void setExtent(Extent newValue)
    Deprecated.
    As of ISO 19115:2014, replaced by `setExtents(Collection)`.
    Sets information about the spatial, vertical and temporal extent of the data specified by the scope. This method stores the value in the extents collection.
    Parameters:
      `newValue` - The new extent.

  - ### getLevelDescription

    public Collection<ScopeDescription> getLevelDescription()
    Returns detailed descriptions about the level of the data specified by the scope.
    Specified by:
      `getLevelDescription` in interface `Scope`
    Returns:
      detailed description about the level of the data.

  - ### setLevelDescription

    public void setLevelDescription(Collection<? extends ScopeDescription> newValues)
    Sets detailed descriptions about the level of the data specified by the scope.
    Parameters:
      `newValues` - the new level description.