001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2004, Institut de Recherche pour le Développement
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * This package contains documentation from OpenGIS specifications.
018: * OpenGIS consortium's work is fully acknowledged here.
019: */
020: package org.geotools.metadata.iso.spatial;
021:
022: // J2SE direct dependencies
023: import java.util.Collection;
024:
025: // OpenGIS dependencies
026: import org.opengis.metadata.spatial.GeometricObjects;
027: import org.opengis.metadata.spatial.TopologyLevel;
028: import org.opengis.metadata.spatial.VectorSpatialRepresentation;
029:
030: /**
031: * Information about the vector spatial objects in the dataset.
032: *
033: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/spatial/VectorSpatialRepresentationImpl.java $
034: * @version $Id: VectorSpatialRepresentationImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
035: * @author Martin Desruisseaux
036: * @author Touraïvane
037: *
038: * @since 2.1
039: */
040: public class VectorSpatialRepresentationImpl extends
041: SpatialRepresentationImpl implements
042: VectorSpatialRepresentation {
043: /**
044: * Serial number for interoperability with different versions.
045: */
046: private static final long serialVersionUID = 5643234643524810592L;
047:
048: /**
049: * Code which identifies the degree of complexity of the spatial relationships.
050: */
051: private TopologyLevel topologyLevel;
052:
053: /**
054: * Information about the geometric objects used in the dataset.
055: */
056: private Collection geometricObjects;
057:
058: /**
059: * Constructs an initially empty vector spatial representation.
060: */
061: public VectorSpatialRepresentationImpl() {
062: }
063:
064: /**
065: * Constructs a metadata entity initialized with the values from the specified metadata.
066: *
067: * @since 2.4
068: */
069: public VectorSpatialRepresentationImpl(
070: final VectorSpatialRepresentation source) {
071: super (source);
072: }
073:
074: /**
075: * Code which identifies the degree of complexity of the spatial relationships.
076: */
077: public TopologyLevel getTopologyLevel() {
078: return topologyLevel;
079: }
080:
081: /**
082: * Set the code which identifies the degree of complexity of the spatial relationships.
083: */
084: public synchronized void setTopologyLevel(
085: final TopologyLevel newValue) {
086: checkWritePermission();
087: topologyLevel = newValue;
088: }
089:
090: /**
091: * Information about the geometric objects used in the dataset.
092: */
093: public synchronized Collection getGeometricObjects() {
094: return geometricObjects = nonNullCollection(geometricObjects,
095: GeometricObjects.class);
096: }
097:
098: /**
099: * Set information about the geometric objects used in the dataset.
100: */
101: public synchronized void setGeometricObjects(
102: final Collection newValues) {
103: geometricObjects = copyCollection(newValues, geometricObjects,
104: GeometricObjects.class);
105: }
106: }
|