01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
05: * (C) 2004, Institut de Recherche pour le Développement
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation;
10: * version 2.1 of the License.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * This package contains documentation from OpenGIS specifications.
18: * OpenGIS consortium's work is fully acknowledged here.
19: */
20: package org.geotools.metadata.iso.extent;
21:
22: // J2SE direct dependencies
23: import java.util.Collection;
24: import java.util.Date;
25:
26: // OpenGIS dependencies
27: import org.opengis.metadata.extent.GeographicExtent;
28: import org.opengis.metadata.extent.SpatialTemporalExtent;
29:
30: /**
31: * Boundary enclosing the dataset, expressed as the closed set of
32: * (<var>x</var>,<var>y</var>) coordinates of the polygon. The last
33: * point replicates first point.
34: *
35: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/extent/SpatialTemporalExtentImpl.java $
36: * @version $Id: SpatialTemporalExtentImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
37: * @author Martin Desruisseaux
38: * @author Touraïvane
39: *
40: * @since 2.1
41: */
42: public class SpatialTemporalExtentImpl extends TemporalExtentImpl
43: implements SpatialTemporalExtent {
44: /**
45: * Serial number for interoperability with different versions.
46: */
47: private static final long serialVersionUID = 821702768255546660L;
48:
49: /**
50: * The spatial extent component of composite
51: * spatial and temporal extent.
52: */
53: private Collection spatialExtent;
54:
55: /**
56: * Constructs an initially empty spatial-temporal extent.
57: */
58: public SpatialTemporalExtentImpl() {
59: }
60:
61: /**
62: * Constructs a metadata entity initialized with the values from the specified metadata.
63: *
64: * @since 2.4
65: */
66: public SpatialTemporalExtentImpl(final SpatialTemporalExtent source) {
67: super (source);
68: }
69:
70: /**
71: * Creates a spatial-temporal extent initialized to the specified values.
72: */
73: public SpatialTemporalExtentImpl(final Date startTime,
74: final Date endTime, final Collection spatialExtent) {
75: super (startTime, endTime);
76: setSpatialExtent(spatialExtent);
77: }
78:
79: /**
80: * Returns the spatial extent component of composite
81: * spatial and temporal extent.
82: *
83: * @return The list of geographic extents (never {@code null}).
84: */
85: public synchronized Collection getSpatialExtent() {
86: return spatialExtent = nonNullCollection(spatialExtent,
87: GeographicExtent.class);
88: }
89:
90: /**
91: * Set the spatial extent component of composite
92: * spatial and temporal extent.
93: */
94: public synchronized void setSpatialExtent(final Collection newValues) {
95: spatialExtent = copyCollection(newValues, spatialExtent,
96: GeographicExtent.class);
97: }
98: }
|