/*
* 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.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 javax.xml.bind.annotation.XmlValue;
import org.geotoolkit.util.Utilities;
/**
* Number with a scale.
* The value of uom (Units Of Measure) attribute is a reference to a Reference System for the amount, either a ratio or position scale.
*
* <p>Java class for MeasureType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MeasureType">
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>double">
* <attribute name="uom" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
* @module
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MeasureType", propOrder = {
"value"
})
@XmlSeeAlso({
SpeedType.class,
ScaleType.class,
AngleType.class,
VolumeType.class,
GridLengthType.class,
LengthType.class,
AreaType.class,
TimeType.class
})
public class MeasureType {
@XmlValue
private double value;
@XmlAttribute(required = true)
@XmlSchemaType(name = "anyURI")
private String uom;
public MeasureType() {
}
public MeasureType(final double value, final String uom) {
this.uom = uom;
this.value = value;
}
/**
* Gets the value of the value property.
*
*/
public double getValue() {
return value;
}
/**
* Sets the value of the value property.
*
*/
public void setValue(final double value) {
this.value = value;
}
/**
* Gets the value of the uom property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUom() {
return uom;
}
/**
* Sets the value of the uom property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUom(final String value) {
this.uom = value;
}
/**
* Vérifie que cette station est identique à l'objet spécifié
*/
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (object instanceof MeasureType) {
final MeasureType that = (MeasureType) object;
return Objects.equals(this.uom, that.uom) &&
Objects.equals(this.value, that.value);
}
return false;
}
@Override
public int hashCode() {
int hash = 3;
hash = 23 * hash + (int) (Double.doubleToLongBits(this.value) ^ (Double.doubleToLongBits(this.value) >>> 32));
hash = 23 * hash + (this.uom != null ? this.uom.hashCode() : 0);
return hash;
}
/**
* Retourne une chaine de charactere representant la station.
*/
@Override
public String toString() {
StringBuilder s = new StringBuilder("[").append(this.getClass().getSimpleName()).append("]\n");
if (uom != null) {
s.append("uom = ").append(uom).append('\n');
}
s.append("value = ").append(value).append('\n');
return s.toString();
}
}