/* * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2008 - 2009, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotoolkit.gml.xml.v311; import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.apache.sis.util.ComparisonMode; /** * A solid is the basis for 3-dimensional geometry. The extent of a solid is defined by the boundary surfaces (shells). A shell is represented by a composite surface, where every shell is used to represent a single connected component of the boundary of a solid. It consists of a composite surface (a list of orientable surfaces) connected in a topological cycle (an object whose boundary is empty). Unlike a Ring, a Shell's elements have no natural sort order. Like Rings, Shells are simple. * * <p>Java class for SolidType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="SolidType"> * <complexContent> * <extension base="{http://www.opengis.net/gml}AbstractSolidType"> * <sequence> * <element name="exterior" type="{http://www.opengis.net/gml}SurfacePropertyType" minOccurs="0"/> * <element name="interior" type="{http://www.opengis.net/gml}SurfacePropertyType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SolidType", propOrder = { "exterior", "interior" }) @XmlRootElement(name="Solid") public class SolidType extends AbstractSolidType { private SurfacePropertyType exterior; private List<SurfacePropertyType> interior; /** * Gets the value of the exterior property. * * @return * possible object is * {@link SurfacePropertyType } * */ public SurfacePropertyType getExterior() { return exterior; } /** * Sets the value of the exterior property. * * @param value * allowed object is * {@link SurfacePropertyType } * */ public void setExterior(final SurfacePropertyType value) { this.exterior = value; } /** * Gets the value of the interior property. * * Objects of the following type(s) are allowed in the list * {@link SurfacePropertyType } * * */ public List<SurfacePropertyType> getInterior() { if (interior == null) { interior = new ArrayList<SurfacePropertyType>(); } return this.interior; } /** * Verify that the point is identical to the specified object. */ @Override public boolean equals(final Object object, final ComparisonMode mode) { if (object == this) { return true; } if (object instanceof SolidType && super.equals(object, mode)) { final SolidType that = (SolidType) object; return Objects.equals(this.exterior, that.exterior) && Objects.equals(this.interior, that.interior); } return false; } @Override public int hashCode() { int hash = 5; hash = 23 * hash + (this.exterior != null ? this.exterior.hashCode() : 0); hash = 23 * hash + (this.interior != null ? this.interior.hashCode() : 0); return hash; } @Override public String toString() { final StringBuilder sb = new StringBuilder(super.toString()).append('\n'); if (exterior != null) { sb.append("exterior:").append(exterior).append('\n'); } if (interior != null) { sb.append("interior:").append('\n'); for (SurfacePropertyType s : interior) { sb.append(s).append('\n'); } } return sb.toString(); } }