gov.nih.nlm.umls.meta.impl
Class ReleaseMetadataImpl

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.ReleaseMetadataImpl
All Implemented Interfaces:
Comparable, ReleaseMetadata

public class ReleaseMetadataImpl
extends Object
implements ReleaseMetadata

Default implementation of the ReleaseMetadata interface.

Author:
Brian Carlsen, Deborah Shapiro

Field Summary
protected  String key_fields
           
protected  boolean key_fields_flag
           
 
Constructor Summary
ReleaseMetadataImpl()
          Instantiates an empty ReleaseMetadataImpl.
ReleaseMetadataImpl(ReleaseMetadataImpl rm)
          Instantiates a ReleaseMetadataImpl from the specified ReleaseMetadataImpl.
 
Method Summary
 void addAncillaryFile(String file_name, Reader reader)
          Adds ancillary file to HashMap of ancillary files.
 void addAtomMapping(AtomMapping cm)
          Adds the specified AtomMapping.
 void addChangeFile(String file_name, Reader reader)
          Adds change file to HashMap of change files.
 void addConceptMapping(ConceptMapping cm)
          Adds the specified ConceptMapping.
 void addCUIRemovedFromSubset(String cui)
          Add SUBX cui to list of cuis removed from subset.
 void addMetadata(MetaDescription md)
          Adds the specified MetaDescription.
 void addSourceMetaDescription(SourceMetaDescription smd)
          Adds the specified SourceMetaDescription.
 void clearAtomMappings()
          Removes all AtomMappings.
 void clearConceptMappings()
          Removes all ConceptMappings.
 void clearMetadata()
          Removes all MetaDescriptions.
 void clearSourceMetaDescription()
          Removes all SourceMetaDescriptions.
 int compareTo(Object o)
          Compares this ReleaseMetadata with the specified object for order.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 Reader getAncillaryFile(String file_name)
          Returns a Reader for the given ancillary file.
 String[] getAncillaryFileNames()
          Returns a String[] of all the ancillary file names.
 AtomMapping[] getAtomMappings()
          Returns all AtomMappings.
 List getAtomMappingsAsList()
          Returns all AtomMappings as a List.
 Reader getChangeFile(String file_name)
          Returns the Reader for the given CHANGE file.
 String[] getChangeFileNames()
          Returns a String[] of all the file names in the CHANGE directory.
 ConceptMapping[] getConceptMappings()
          Returns all ConceptMappings.
 List getConceptMappingsAsList()
          Returns all ConceptMappings as a List.
 String[] getCUIsRemovedFromSubset()
          List of SUBX cuis.
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 MetaDescription[] getMetadata()
          Returns MetaDescriptions in the current subset.
 List getMetadataAsList()
          Returns MetaDescription in the current subset as a List.
 Date getReleaseDate()
          Returns the release Date.
 String getReleaseDescription()
          Returns the release description.
 String getReleaseVersion()
          Returns the release version.
 SourceMetaDescription[] getSourceMetadata()
          Returns SourceMetaDescriptions in the current subset.
 List getSourceMetadataAsList()
          Returns SourceMetaDescription in the current subset as a List.
 SourceTermType[] getSourceTermTypePrecedence()
          Returns all SourceTermTypes in rank order.
 List getSourceTermTypePrecedenceAsList()
          Returns all SourceTermTypes in rank order as a List.
 int hashCode()
          Returns a hash code based on key fields.
 void removeAtomMapping(AtomMapping cm)
          Removes the specified AtomMapping.
 void removeConceptMapping(ConceptMapping cm)
          Removes the specified ConceptMapping.
 void removeMetadata(MetaDescription md)
          Removes the specified MetaDescription.
 void removeSourceMetaDescription(SourceMetaDescription smd)
          Removes the specified SourceMetaDescription.
 void setAtomMappings(AtomMapping[] cm)
          Sets the AtomMappings.
 void setAtomMappings(List cm)
          Sets the AtomMappings.
 void setConceptMappings(ConceptMapping[] cm)
          Sets the ConceptMappings.
 void setConceptMappings(List cm)
          Sets the ConceptMappings.
 void setMetadata(List docs)
          Sets MetaDescriptions in the current subset.
 void setMetadata(MetaDescription[] docs)
          Sets MetaDescription in the current subset.
 void setReleaseDate(Date rd)
          Sets the release Date.
 void setReleaseDescription(String rd)
          Sets the release description.
 void setReleaseVersion(String rv)
          Sets the release version.
 void setSourceMetadata(List sabs)
          Sets SourceMetaDescriptions in the current subset.
 void setSourceMetadata(SourceMetaDescription[] sabs)
          Sets SourceMetaDescription in the current subset.
 void setSourceTermTypePrecedence(List sab_ttys)
          Sets all SourceTermTypes in rank order.
 void setSourceTermTypePrecedence(SourceTermType[] sab_ttys)
          Sets all SourceTermTypes in rank order.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key_fields_flag

protected boolean key_fields_flag

key_fields

protected String key_fields
Constructor Detail

ReleaseMetadataImpl

public ReleaseMetadataImpl()
Instantiates an empty ReleaseMetadataImpl.


ReleaseMetadataImpl

public ReleaseMetadataImpl(ReleaseMetadataImpl rm)
Instantiates a ReleaseMetadataImpl from the specified ReleaseMetadataImpl.

Parameters:
rm - ReleaseMetadataImpl to be copied
Method Detail

getReleaseVersion

public String getReleaseVersion()
Returns the release version.

Specified by:
getReleaseVersion in interface ReleaseMetadata
Returns:
the release version

setReleaseVersion

public void setReleaseVersion(String rv)
Sets the release version.

Specified by:
setReleaseVersion in interface ReleaseMetadata
Parameters:
rv - the release version

getReleaseDate

public Date getReleaseDate()
Returns the release Date.

Specified by:
getReleaseDate in interface ReleaseMetadata
Returns:
the release Date.

setReleaseDate

public void setReleaseDate(Date rd)
Sets the release Date.

Specified by:
setReleaseDate in interface ReleaseMetadata
Parameters:
rd - the release Date

getReleaseDescription

public String getReleaseDescription()
Returns the release description.

Specified by:
getReleaseDescription in interface ReleaseMetadata
Returns:
the release description

setReleaseDescription

public void setReleaseDescription(String rd)
Sets the release description.

Specified by:
setReleaseDescription in interface ReleaseMetadata
Parameters:
rd - the release description

getSourceMetadata

public SourceMetaDescription[] getSourceMetadata()
Returns SourceMetaDescriptions in the current subset.

Specified by:
getSourceMetadata in interface ReleaseMetadata
Returns:
an array of all SourceMetaDescription in the current subset

getSourceMetadataAsList

public List getSourceMetadataAsList()
Returns SourceMetaDescription in the current subset as a List.

Specified by:
getSourceMetadataAsList in interface ReleaseMetadata
Returns:
SourceMetaDescription in the current subset as a List

setSourceMetadata

public void setSourceMetadata(SourceMetaDescription[] sabs)
Sets SourceMetaDescription in the current subset.

Specified by:
setSourceMetadata in interface ReleaseMetadata
Parameters:
sabs - the SourceMetaDescription in the current subset

setSourceMetadata

public void setSourceMetadata(List sabs)
Sets SourceMetaDescriptions in the current subset.

Specified by:
setSourceMetadata in interface ReleaseMetadata
Parameters:
sabs - a List of SourceMetaDescriptions in the current subset

addSourceMetaDescription

public void addSourceMetaDescription(SourceMetaDescription smd)
Adds the specified SourceMetaDescription.

Specified by:
addSourceMetaDescription in interface ReleaseMetadata
Parameters:
smd - the SourceMetaDescription to be added

removeSourceMetaDescription

public void removeSourceMetaDescription(SourceMetaDescription smd)
Removes the specified SourceMetaDescription.

Specified by:
removeSourceMetaDescription in interface ReleaseMetadata
Parameters:
smd - the SourceMetaDescription to be removed

clearSourceMetaDescription

public void clearSourceMetaDescription()
Removes all SourceMetaDescriptions.

Specified by:
clearSourceMetaDescription in interface ReleaseMetadata

getConceptMappings

public ConceptMapping[] getConceptMappings()
Returns all ConceptMappings.

Specified by:
getConceptMappings in interface ReleaseMetadata
Returns:
an array of all ConceptMappings

getConceptMappingsAsList

public List getConceptMappingsAsList()
Returns all ConceptMappings as a List.

Specified by:
getConceptMappingsAsList in interface ReleaseMetadata
Returns:
all ConceptMappings

setConceptMappings

public void setConceptMappings(ConceptMapping[] cm)
Sets the ConceptMappings.

Specified by:
setConceptMappings in interface ReleaseMetadata
Parameters:
cm - the ConceptMappings

addConceptMapping

public void addConceptMapping(ConceptMapping cm)
Adds the specified ConceptMapping.

Specified by:
addConceptMapping in interface ReleaseMetadata
Parameters:
cm - the ConceptMapping to be added

removeConceptMapping

public void removeConceptMapping(ConceptMapping cm)
Removes the specified ConceptMapping.

Specified by:
removeConceptMapping in interface ReleaseMetadata
Parameters:
cm - the ConceptMapping to be removed

clearConceptMappings

public void clearConceptMappings()
Removes all ConceptMappings.

Specified by:
clearConceptMappings in interface ReleaseMetadata

setConceptMappings

public void setConceptMappings(List cm)
Sets the ConceptMappings.

Specified by:
setConceptMappings in interface ReleaseMetadata
Parameters:
cm - a List of the ConceptMappings

getCUIsRemovedFromSubset

public String[] getCUIsRemovedFromSubset()
List of SUBX cuis.

Specified by:
getCUIsRemovedFromSubset in interface ReleaseMetadata
Returns:
array of SUBX cuis

addCUIRemovedFromSubset

public void addCUIRemovedFromSubset(String cui)
Add SUBX cui to list of cuis removed from subset.

Specified by:
addCUIRemovedFromSubset in interface ReleaseMetadata
Parameters:
cui - String

getAtomMappings

public AtomMapping[] getAtomMappings()
Returns all AtomMappings.

Specified by:
getAtomMappings in interface ReleaseMetadata
Returns:
an array of all AtomMappings

getAtomMappingsAsList

public List getAtomMappingsAsList()
Returns all AtomMappings as a List.

Specified by:
getAtomMappingsAsList in interface ReleaseMetadata
Returns:
all AtomMappings

setAtomMappings

public void setAtomMappings(AtomMapping[] cm)
Sets the AtomMappings.

Specified by:
setAtomMappings in interface ReleaseMetadata
Parameters:
cm - the AtomMappings

addAtomMapping

public void addAtomMapping(AtomMapping cm)
Adds the specified AtomMapping.

Specified by:
addAtomMapping in interface ReleaseMetadata
Parameters:
cm - the AtomMapping to be added

removeAtomMapping

public void removeAtomMapping(AtomMapping cm)
Removes the specified AtomMapping.

Specified by:
removeAtomMapping in interface ReleaseMetadata
Parameters:
cm - the AtomMapping to be removed

clearAtomMappings

public void clearAtomMappings()
Removes all AtomMappings.

Specified by:
clearAtomMappings in interface ReleaseMetadata

setAtomMappings

public void setAtomMappings(List cm)
Sets the AtomMappings.

Specified by:
setAtomMappings in interface ReleaseMetadata
Parameters:
cm - a List of the AtomMappings

getSourceTermTypePrecedence

public SourceTermType[] getSourceTermTypePrecedence()
Returns all SourceTermTypes in rank order.

Specified by:
getSourceTermTypePrecedence in interface ReleaseMetadata
Returns:
an array of all SourceTermTypes in rank order

getSourceTermTypePrecedenceAsList

public List getSourceTermTypePrecedenceAsList()
Returns all SourceTermTypes in rank order as a List.

Specified by:
getSourceTermTypePrecedenceAsList in interface ReleaseMetadata
Returns:
all SourceTermTypes in rank order as a List

setSourceTermTypePrecedence

public void setSourceTermTypePrecedence(SourceTermType[] sab_ttys)
Sets all SourceTermTypes in rank order.

Specified by:
setSourceTermTypePrecedence in interface ReleaseMetadata
Parameters:
sab_ttys - an array of all SourceTermTypes in rank order

setSourceTermTypePrecedence

public void setSourceTermTypePrecedence(List sab_ttys)
Sets all SourceTermTypes in rank order.

Specified by:
setSourceTermTypePrecedence in interface ReleaseMetadata
Parameters:
sab_ttys - a List of all SourceTermTypes in rank order

getMetadata

public MetaDescription[] getMetadata()
Returns MetaDescriptions in the current subset.

Specified by:
getMetadata in interface ReleaseMetadata
Returns:
an array of all MetaDescriptions in the current subset

getMetadataAsList

public List getMetadataAsList()
Returns MetaDescription in the current subset as a List.

Specified by:
getMetadataAsList in interface ReleaseMetadata
Returns:
MetaDescription in the current subset as a List

setMetadata

public void setMetadata(MetaDescription[] docs)
Sets MetaDescription in the current subset.

Specified by:
setMetadata in interface ReleaseMetadata
Parameters:
docs - the MetaDescription in the current subset

setMetadata

public void setMetadata(List docs)
Sets MetaDescriptions in the current subset.

Specified by:
setMetadata in interface ReleaseMetadata
Parameters:
docs - a List of MetaDescriptions in the current subset

addMetadata

public void addMetadata(MetaDescription md)
Adds the specified MetaDescription.

Specified by:
addMetadata in interface ReleaseMetadata
Parameters:
md - the MetaDescription to be added

removeMetadata

public void removeMetadata(MetaDescription md)
Removes the specified MetaDescription.

Specified by:
removeMetadata in interface ReleaseMetadata
Parameters:
md - the MetaDescription to be removed

clearMetadata

public void clearMetadata()
Removes all MetaDescriptions.

Specified by:
clearMetadata in interface ReleaseMetadata

getChangeFileNames

public String[] getChangeFileNames()
Returns a String[] of all the file names in the CHANGE directory.

Specified by:
getChangeFileNames in interface ReleaseMetadata
Returns:
array of all the file names in the CHANGE directory

getChangeFile

public Reader getChangeFile(String file_name)
Returns the Reader for the given CHANGE file.

Specified by:
getChangeFile in interface ReleaseMetadata
Parameters:
file_name - for CHANGE file
Returns:
Reader for the given CHANGE file

getAncillaryFileNames

public String[] getAncillaryFileNames()
Returns a String[] of all the ancillary file names.

Specified by:
getAncillaryFileNames in interface ReleaseMetadata
Returns:
array of all the ancillary file names

getAncillaryFile

public Reader getAncillaryFile(String file_name)
Returns a Reader for the given ancillary file.

Specified by:
getAncillaryFile in interface ReleaseMetadata
Parameters:
file_name - for given ancillary file
Returns:
a Reader for the given ancillary file

addChangeFile

public void addChangeFile(String file_name,
                          Reader reader)
Adds change file to HashMap of change files.

Specified by:
addChangeFile in interface ReleaseMetadata
Parameters:
file_name - name of change file
reader - a Reader over the file

addAncillaryFile

public void addAncillaryFile(String file_name,
                             Reader reader)
Adds ancillary file to HashMap of ancillary files.

Specified by:
addAncillaryFile in interface ReleaseMetadata
Parameters:
file_name - name of ancillary file
reader - a Reader over the file

getKeyFields

public String getKeyFields()
Returns a String key which can be used by equals, compareTo, and hashCode methods.

Specified by:
getKeyFields in interface ReleaseMetadata
Returns:
a String composed from the release version, date, and description fields.

equals

public boolean equals(Object o)
Returns true if the specified object is equal to this object. The specified object must be a ReleaseMetadata with matching key fields.

Parameters:
o - an Object to compare against
Returns:
boolean true if Object o is equal; false otherwise.

hashCode

public int hashCode()
Returns a hash code based on key fields.

Returns:
a hash code based on key fields.

compareTo

public int compareTo(Object o)
Compares this ReleaseMetadata with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Results are indeterminate if the specified parameter is not of the same class.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Returns zero if the specified object's type prevents it from being compared to this Object.


Copyright ©2005