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: