Project

General

Profile

« Previous | Next » 

Revision 7b23180d

Added by Andreas Müller over 9 years ago

Geo and time scope for Classifications #3699

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/Classification.java
60 60
    "rootNode",
61 61
    "reference",
62 62
    "microReference",
63
    "timeperiod"
63
    "timeperiod",
64
    "geoScopes"
64 65
})
65 66
@XmlRootElement(name = "Classification")
66 67
@Entity
......
526 527
		}
527 528
		this.timeperiod = timeperiod;
528 529
	}
530
	
531

  
532
    /**
533
     * Returns the set of {@link NamedArea named areas} indicating the geospatial
534
     * data where <i>this</i> {@link Classification} is valid.
535
     */
536
    public Set<NamedArea> getGeoScopes(){
537
        return this.geoScopes;
538
    }
539

  
540
    /**
541
     * Adds a {@link NamedArea named area} to the set of {@link #getGeoScopes() named areas}
542
     * delimiting the geospatial area where <i>this</i> {@link Classification} is valid.
543
     *
544
     * @param geoScope	the named area to be additionally assigned to <i>this</i> taxon description
545
     * @see    	   		#getGeoScopes()
546
     */
547
    public void addGeoScope(NamedArea geoScope){
548
        this.geoScopes.add(geoScope);
549
    }
550

  
551
    /**
552
     * Removes one element from the set of {@link #getGeoScopes() named areas} delimiting
553
     * the geospatial area where <i>this</i> {@link Classification} is valid.
554
     *
555
     * @param  geoScope   the named area which should be removed
556
     * @see     		  #getGeoScopes()
557
     * @see     		  #addGeoScope(NamedArea)
558
     */
559
    public void removeGeoScope(NamedArea geoScope){
560
        this.geoScopes.remove(geoScope);
561
    }
529 562

  
530 563
    @Override
531 564
    public String generateTitle() {
......
572 605
                result.addChildNode(rootNodeClone, rootNode.getReference(), rootNode.getMicroReference());
573 606
                rootNodeClone.setSynonymToBeUsed(rootNode.getSynonymToBeUsed());
574 607
            }
608
            
609
            //geo-scopes
610
            result.geoScopes = new HashSet<NamedArea>();
611
            for (NamedArea namedArea : getGeoScopes()){
612
                result.geoScopes.add(namedArea);
613
            }
575 614

  
576 615
            return result;
577 616

  

Also available in: Unified diff