(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / occurrence / GatheringEvent.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.model.occurrence;
11
12 import java.util.Calendar;
13
14 import javax.persistence.Entity;
15 import javax.persistence.ManyToOne;
16 import javax.persistence.Transient;
17
18 import org.apache.log4j.Logger;
19 import eu.etaxonomy.cdm.model.agent.Agent;
20 import eu.etaxonomy.cdm.model.common.EventBase;
21 import eu.etaxonomy.cdm.model.location.NamedArea;
22 import eu.etaxonomy.cdm.model.location.Point;
23
24 /**
25 * The event when gathering a specimen or recording a field observation only
26 * @author m.doering
27 *
28 */
29 @Entity
30 public class GatheringEvent extends EventBase {
31 static Logger logger = Logger.getLogger(GatheringEvent.class);
32
33 //Locality name (as free text) where this occurrence happened
34 private String locality;
35 private Point exactLocation;
36 private NamedArea collectingArea;
37 private String collectingMethod;
38 // meter above/below sea level of the surface
39 private Integer absoluteElevation;
40 private Integer absoluteElevationError;
41 // distance in meter from the ground surface when collecting. E.g. 10m below the ground or 10m above the ground/bottom of a lake or 20m up in the canope
42 private Integer distanceToGround;
43 // distance in meters to lake or sea surface. Simmilar to distanceToGround use negative integers for distance *below* the surface, ie under water
44 private Integer distanceToWaterSurface;
45
46
47 /**
48 * Factory method
49 * @return
50 */
51 public static GatheringEvent NewInstance(){
52 return new GatheringEvent();
53 }
54
55 /**
56 * Constructor
57 */
58 protected GatheringEvent() {
59 super();
60 }
61
62 public Point getExactLocation(){
63 return this.exactLocation;
64 }
65 public void setExactLocation(Point exactLocation){
66 this.exactLocation = exactLocation;
67 }
68
69 @ManyToOne
70 public NamedArea getCollectingArea(){
71 return this.collectingArea;
72 }
73 public void setCollectingArea(NamedArea area){
74 this.collectingArea = area;
75 }
76
77 public String getLocality(){
78 return this.locality;
79 }
80 public void setLocality(String locality){
81 this.locality = locality;
82 }
83
84 /**
85 * EventBase managed attributes
86 * @return
87 */
88 @Transient
89 public Calendar getGatheringDate(){
90 return this.getTimeperiod().getStart();
91 }
92 public void setGatheringDate(Calendar gatheringDate){
93 this.getTimeperiod().setStart(gatheringDate);
94 }
95
96 @Transient
97 public Agent getCollector(){
98 return this.getActor();
99 }
100 public void setCollector(Agent collector){
101 this.setActor(collector);
102 }
103
104
105 public String getCollectingMethod() {
106 return collectingMethod;
107 }
108 public void setCollectingMethod(String collectingMethod) {
109 this.collectingMethod = collectingMethod;
110 }
111
112
113 public Integer getAbsoluteElevation() {
114 return absoluteElevation;
115 }
116
117 public void setAbsoluteElevation(Integer absoluteElevation) {
118 this.absoluteElevation = absoluteElevation;
119 }
120
121
122 public Integer getAbsoluteElevationError() {
123 return absoluteElevationError;
124 }
125 public void setAbsoluteElevationError(Integer absoluteElevationError) {
126 this.absoluteElevationError = absoluteElevationError;
127 }
128 public Integer getDistanceToGround() {
129 return distanceToGround;
130 }
131 public void setDistanceToGround(Integer distanceToGround) {
132 this.distanceToGround = distanceToGround;
133 }
134 public Integer getDistanceToWaterSurface() {
135 return distanceToWaterSurface;
136 }
137 public void setDistanceToWaterSurface(Integer distanceToWaterSurface) {
138 this.distanceToWaterSurface = distanceToWaterSurface;
139 }
140
141 }