/*
* 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.swe.xml.v100;
import java.net.URI;
import java.util.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import org.geotoolkit.swe.xml.AbstractVector;
import org.apache.sis.util.ComparisonMode;
/**
* <p>Java class for AbstractVectorType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AbstractVectorType">
* <complexContent>
* <extension base="{http://www.opengis.net/swe/1.0}AbstractDataRecordType">
* <attribute name="referenceFrame" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* <attribute name="localFrame" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
* @module
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractVectorType")
@XmlSeeAlso({
GeoLocationArea.class,
VectorType.class,
EnvelopeType.class,
PositionType.class
})
public abstract class AbstractVectorType extends AbstractDataRecordType implements AbstractVector {
@XmlAttribute
@XmlSchemaType(name = "anyURI")
private URI referenceFrame;
@XmlAttribute
@XmlSchemaType(name = "anyURI")
private URI localFrame;
public AbstractVectorType() {
}
public AbstractVectorType(final AbstractVector av) {
super(av);
if (av != null) {
this.localFrame = av.getLocalFrame();
this.referenceFrame = av.getReferenceFrame();
}
}
public AbstractVectorType(final String definition) {
super(definition);
}
public AbstractVectorType(final URI referenceFrame, final URI localFrame) {
this.localFrame = localFrame;
this.referenceFrame = referenceFrame;
}
/**
* Gets the value of the referenceFrame property.
*/
@Override
public URI getReferenceFrame() {
return referenceFrame;
}
/**
* Sets the value of the referenceFrame property.
*/
@Override
public void setReferenceFrame(final URI value) {
this.referenceFrame = value;
}
/**
* Gets the value of the localFrame property.
*/
@Override
public URI getLocalFrame() {
return localFrame;
}
/**
* Sets the value of the localFrame property.
*/
@Override
public void setLocalFrame(final URI value) {
this.localFrame = value;
}
/**
* Verify if this entry is identical to specified object.
*/
@Override
public boolean equals(final Object object, final ComparisonMode mode) {
if (object == this) {
return true;
}
if (object instanceof AbstractVectorType && super.equals(object, mode)) {
final AbstractVectorType that = (AbstractVectorType) object;
return Objects.equals(this.localFrame, that.localFrame)&&
Objects.equals(this.referenceFrame, that.referenceFrame);
}
return false;
}
@Override
public int hashCode() {
int hash = 3;
hash = 79 * hash + (this.referenceFrame != null ? this.referenceFrame.hashCode() : 0);
hash = 79 * hash + (this.localFrame != null ? this.localFrame.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder s = new StringBuilder(super.toString());
if (localFrame != null) {
s.append("localFrame:").append(localFrame).append('\n');
}
if (referenceFrame != null) {
s.append("referenceFrame:").append(referenceFrame).append('\n');
}
return s.toString();
}
}