CHANGES TO THE CDMLIB-MODEL: Media and DefinedTermBase become IdentifiableEntity...
authorh.fradin <h.fradin@localhost>
Mon, 17 Aug 2009 09:54:28 +0000 (09:54 +0000)
committerh.fradin <h.fradin@localhost>
Mon, 17 Aug 2009 09:54:28 +0000 (09:54 +0000)
commit17f0cc4b15eabb34717d24ef162171782c14679a
tree0828d5570041b8fa0fc4c428c67131da7fb99321
parent8eaa860e78d60d4bcd7726adffe3dbbb7f31cd04
CHANGES TO THE CDMLIB-MODEL: Media and DefinedTermBase become IdentifiableEntity, new classes to represent descriptive dataset and keys

1. Media extends IdentifiableEntity
- addition of a ComparableTo method
- deletion of the redundant attribute 'rights'

2. TermBase extends IdentifiableEntity

There was redundancy with 'implements Comparable<T>' in OrderedTermBase and 'implements Comparable<IdentifiableEntity>' in IdentifiableIdentity.

- I erased « implements Comparable<T> » dans OrderedTermBase
- I completed it with a 'ghost' method CompareTo(Object)

public int compareTo(Object o) {
return 0;
}

- I added the same 'ghost' CompareTo(Object) method to the following classes: BibtexEntryType, DerivationEventType, PreservationMethod, RightsTerm, NamedAreaType, ReferenceSystem, Feature, FeatureTree, MeasurementUnit, StatisticalMeasure, TextFormat, AnnotationType, ExtensionType, Language, MarkerType, TermVocabulary, InstitutionType

3. adding OnlyApplicableIf / InapplicableIf to FeatureNode

private Set<State> onlyApplicableIf = new HashSet<State>();
private Set<State> inapplicableIf = new HashSet<State>();

with the associated get, add, remove methods.

These attributes are not direct equivalent for onlyApplicableIf and inapplicableIf in SDD as they are attached directly to the child feature rather than the parent feature, which allow having different inapplicability rules for each child feature.

4. Creation of the WorkingSet class

public class WorkingSet<S extends DescriptionBase> extends AnnotatableEntity {

private Set<Representation> representations = new HashSet<Representation>();
...
private FeatureTree descriptiveSystem;
...
private Set<S> descriptions = new HashSet<S>();

}

5. Completion of IidentificationKey interface

public interface IIdentificationKey {
    public Set<NamedArea> getGeographicalScope();
    public void addGeographicalScope(NamedArea geographicalScope);
    public void removeGeographicalScope(NamedArea geographicalScope);
    public Set<Taxon> getTaxonomicScope();
    public void addTaxonomicScope(Taxon taxon);
    public void removeTaxonomicScope(Taxon taxon);
    public Set<Scope> getScopeRestrictions();
    public Set<Taxon> getCoveredTaxa();
    public void addCoveredTaxon(Taxon taxon);
    public void removeCoveredTaxon(Taxon taxon);
}

I removed 'representations' as MultiAccessKey and PolytomousKey inherit it from their hierarchy. I added it to MediaKey (former IdentificationKey) under the name of keyRepresentations in order not to mix with the media representations.

6. Modification of IdentificationKey in accordance (and renaming it to MediaKey with all the necessary modifications in concerned classes)
public class MediaKey extends Media implements IIdentificationKey{

private Set<Taxon> coveredTaxa = new HashSet<Taxon>();

private Set<NamedArea> geographicalScope = new HashSet<NamedArea>();

private Set<Taxon> taxonomicScope = new HashSet<Taxon>();

private Set<Scope> scopeRestrictions = new HashSet<Scope>();

private Set<Representation> keyRepresentations = new HashSet<Representation>();

}

7. Creation of the class MultiAccessKey

public class MultiAccessKey extends WorkingSet implements IIdentificationKey{
...
private Set<Taxon> coveredTaxa = new HashSet<Taxon>();
...
private Set<Taxon> taxonomicScope = new HashSet<Taxon>();
...
private Set<NamedArea> geographicalScope = new HashSet<NamedArea>();
...
private Set<Scope> scopeRestrictions = new HashSet<Scope>();
}

8. Creation of PolytomousKey

public class PolytomousKey extends FeatureTree implements IIdentificationKey{
...
private Set<Taxon> coveredTaxa = new HashSet<Taxon>();
...
private Set<Taxon> taxonomicScope = new HashSet<Taxon>();

...
private Set<NamedArea> geographicalScope = new HashSet<NamedArea>();
...
private Set<Scope> scopeRestrictions = new HashSet<Scope>();
}

9. Addition of the attribute 'result', 'question' and 'taxon' to FeatureNode so that a FeatureTree can store the identification path in the case of a polytomous key.

private DescriptionElementBase result;
private Set<Representation> questions = new HashSet<Representation>();
private Taxon taxon;
28 files changed:
.gitattributes
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/InstitutionType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AnnotationType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ExtensionType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermVocabulary.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/package-info.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java [new file with mode: 0644]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MultiAccessKey.java [moved from cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IdentificationKey.java with 59% similarity]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKey.java [new file with mode: 0644]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StatisticalMeasure.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextFormat.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/WorkingSet.java [new file with mode: 0644]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/NamedAreaType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/ReferenceSystem.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/Media.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/RightsTerm.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivationEventType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/BibtexEntryType.java