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
.Media
;
13 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
14 import eu
.etaxonomy
.cdm
.model
.common
.MediaInstance
;
15 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermBase
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.hibernate
.annotations
.Cascade
;
18 import org
.hibernate
.annotations
.CascadeType
;
22 import javax
.persistence
.*;
27 * @created 08-Nov-2007 13:06:36
30 public class NamedArea
extends OrderedTermBase
<NamedArea
> {
31 static Logger logger
= Logger
.getLogger(NamedArea
.class);
32 //description of time valid context of this area. e.g. year range
33 private TimePeriod validPeriod
;
34 //Binary shape definition for user's defined area as polygon
36 private Point pointApproximation
;
37 private Set
<WaterbodyOrCountry
> waterbodiesOrCountries
= new HashSet();
38 private NamedAreaType type
;
39 private NamedAreaLevel level
;
43 // TODO Auto-generated constructor stub
45 public NamedArea(String term
, String label
) {
47 // TODO Auto-generated constructor stub
52 public NamedAreaType
getType(){
55 public void setType(NamedAreaType type
){
60 public NamedAreaLevel
getLevel(){
63 public void setLevel(NamedAreaLevel level
){
67 public TimePeriod
getValidPeriod(){
68 return this.validPeriod
;
70 public void setValidPeriod(TimePeriod validPeriod
){
71 this.validPeriod
= validPeriod
;
75 @Cascade({CascadeType
.SAVE_UPDATE
})
76 public Media
getShape(){
79 public void setShape(Media shape
){
85 public Set
<WaterbodyOrCountry
> getWaterbodiesOrCountries() {
86 return waterbodiesOrCountries
;
88 protected void setWaterbodiesOrCountries(
89 Set
<WaterbodyOrCountry
> waterbodiesOrCountries
) {
90 this.waterbodiesOrCountries
= waterbodiesOrCountries
;
92 public void addWaterbodyOrCountry(
93 WaterbodyOrCountry waterbodyOrCountry
) {
94 this.waterbodiesOrCountries
.add(waterbodyOrCountry
);
96 public void removeWaterbodyOrCountry(
97 WaterbodyOrCountry waterbodyOrCountry
) {
98 this.waterbodiesOrCountries
.remove(waterbodyOrCountry
);
100 public Point
getPointApproximation() {
101 return pointApproximation
;
103 public void setPointApproximation(Point pointApproximation
) {
104 this.pointApproximation
= pointApproximation
;