2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.model
.location
;
11 import java
.io
.Serializable
;
13 import javax
.persistence
.Embeddable
;
14 import javax
.persistence
.FetchType
;
15 import javax
.persistence
.ManyToOne
;
16 import javax
.xml
.bind
.annotation
.XmlAccessType
;
17 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
18 import javax
.xml
.bind
.annotation
.XmlElement
;
19 import javax
.xml
.bind
.annotation
.XmlIDREF
;
20 import javax
.xml
.bind
.annotation
.XmlRootElement
;
21 import javax
.xml
.bind
.annotation
.XmlRootElement
;
22 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
23 import javax
.xml
.bind
.annotation
.XmlType
;
25 import org
.apache
.log4j
.Logger
;
27 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnitBase
;
32 * @created 08-Nov-2007 13:06:44
34 @XmlAccessorType(XmlAccessType
.FIELD
)
35 @XmlType(name
= "Point", propOrder
= {
41 @XmlRootElement(name
= "Point")
43 public class Point
implements Cloneable
, Serializable
{
44 private static final Logger logger
= Logger
.getLogger(Point
.class);
46 //TODO was Float but H2 threw errors
47 @XmlElement(name
= "Longitude")
48 private Double longitude
;
50 @XmlElement(name
= "Latitude")
51 private Double latitude
;
54 @XmlElement(name
= "ErrorRadius")
55 private Integer errorRadius
= 0;
57 @XmlElement(name
= "ReferenceSystem")
59 @XmlSchemaType(name
= "IDREF")
60 @ManyToOne(fetch
= FetchType
.LAZY
)
61 private ReferenceSystem referenceSystem
;
67 public static Point
NewInstance(){
77 public ReferenceSystem
getReferenceSystem(){
78 return this.referenceSystem
;
83 * @param referenceSystem referenceSystem
85 public void setReferenceSystem(ReferenceSystem referenceSystem
){
86 this.referenceSystem
= referenceSystem
;
89 public Double
getLongitude(){
90 return this.longitude
;
95 * @param longitude longitude
97 public void setLongitude(Double longitude
){
98 this.longitude
= longitude
;
101 public Double
getLatitude(){
102 return this.latitude
;
107 * @param latitude latitude
109 public void setLatitude(Double latitude
){
110 this.latitude
= latitude
;
113 public Integer
getErrorRadius(){
114 return this.errorRadius
;
119 * @param errorRadius errorRadius
121 public void setErrorRadius(Integer errorRadius
){
122 this.errorRadius
= errorRadius
;
126 //*********** CLONE **********************************/
129 * Clones <i>this</i> point. This is a shortcut that enables to
130 * create a new instance that differs only slightly from <i>this</i> point
131 * by modifying only some of the attributes.<BR>
132 * This method overrides the clone method from {@link DerivedUnitBase DerivedUnitBase}.
134 * @see java.lang.Object#clone()
137 public Point
clone(){
139 Point result
= (Point
)super.clone();
140 result
.setReferenceSystem(this.referenceSystem
);
141 //no changes to: errorRadius, latitude, longitude
143 } catch (CloneNotSupportedException e
) {
144 logger
.warn("Object does not implement cloneable");