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
;
12 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
13 import eu
.etaxonomy
.cdm
.model
.common
.MediaInstance
;
14 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermBase
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.hibernate
.annotations
.Cascade
;
17 import org
.hibernate
.annotations
.CascadeType
;
21 import javax
.persistence
.*;
26 * @created 08-Nov-2007 13:06:36
29 public class NamedArea
extends OrderedTermBase
<NamedArea
> {
30 static Logger logger
= Logger
.getLogger(NamedArea
.class);
31 //description of time valid context of this area. e.g. year range
32 private TimePeriod validPeriod
;
33 //Binary shape definition for user's defined area as polygon
34 private MediaInstance shapeFile
;
35 private Point pointApproximation
;
36 private Set
<WaterbodyOrCountry
> waterbodiesOrCountries
= new HashSet();
37 private NamedAreaType type
;
38 private NamedAreaLevel level
;
42 // TODO Auto-generated constructor stub
44 public NamedArea(String term
, String label
) {
46 // TODO Auto-generated constructor stub
51 public NamedAreaType
getType(){
54 public void setType(NamedAreaType type
){
59 public NamedAreaLevel
getLevel(){
62 public void setLevel(NamedAreaLevel level
){
66 public TimePeriod
getValidPeriod(){
67 return this.validPeriod
;
69 public void setValidPeriod(TimePeriod validPeriod
){
70 this.validPeriod
= validPeriod
;
74 @Cascade({CascadeType
.SAVE_UPDATE
})
75 public MediaInstance
getShapeFile(){
76 return this.shapeFile
;
78 public void setShapeFile(MediaInstance shapeFile
){
79 this.shapeFile
= shapeFile
;
84 public Set
<WaterbodyOrCountry
> getWaterbodiesOrCountries() {
85 return waterbodiesOrCountries
;
87 protected void setWaterbodiesOrCountries(
88 Set
<WaterbodyOrCountry
> waterbodiesOrCountries
) {
89 this.waterbodiesOrCountries
= waterbodiesOrCountries
;
91 public void addWaterbodyOrCountry(
92 WaterbodyOrCountry waterbodyOrCountry
) {
93 this.waterbodiesOrCountries
.add(waterbodyOrCountry
);
95 public void removeWaterbodyOrCountry(
96 WaterbodyOrCountry waterbodyOrCountry
) {
97 this.waterbodiesOrCountries
.remove(waterbodyOrCountry
);
99 public Point
getPointApproximation() {
100 return pointApproximation
;
102 public void setPointApproximation(Point pointApproximation
) {
103 this.pointApproximation
= pointApproximation
;