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

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.MappingImpl
All Implemented Interfaces:
Comparable, ConceptElement, ContentViewElement, Mapping, SourceElement

public class MappingImpl
extends Object
implements Mapping

Default implementation of Mapping.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.SourceElement
SourceElement.BySourceComparator, SourceElement.BySourceRestrictor
 
Field Summary
protected  String key_fields
           
protected  boolean key_fields_flag
           
 
Constructor Summary
MappingImpl()
          Instantiates an empty MappingImpl.
MappingImpl(Mapping mapping)
          Instantiates a Mapping from the specified Mapping.
 
Method Summary
 int compareTo(Object o)
          Compares this Mapping to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 AdditionalRelationshipLabel getAdditionalRelationshipLabel()
          Returns the AdditionalRelationshipLabel (RELA).
 AttributeName getAttributeName()
          Returns the AttributeName (MAPATN).
 String getAttributeValue()
          Returns the attribute value (MAPATV).
 Concept getConcept()
          Returns the Concept that holds this Mapping (CUI).
 ContentView getContentView()
          Returns tbe ContentView definition for this Mapping (CVF).
 ContentView getCvf()
          Shorthand for getContentView().
 MapObject getFrom()
          Returns the mapped from MapObject.
 String getId()
          Returns the unique identifier (MAPID).
 String getIdentifier()
          Returns the unique identifier (MAPID).
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 String getRank()
          Returns the rank (RANK).
 RelationshipLabel getRel()
          Shorthand for getRelationshipName().
 AdditionalRelationshipLabel getRela()
          Shorthand for getAdditionalRelationshipLabel().
 RelationshipLabel getRelationshipName()
          Returns the RelationshipLabel (REL).
 String getRes()
          Returns the human readable rule for use of mapping (MAPRES).
 String getRestriction()
          Returns the human readable rule for use of mapping (MAPRES).
 String getRule()
          Returns the machine processable rule for when to apply mapping (MAPRULE).
 String getSid()
          Returns the source asserted unique identifier (MAPSID).
 Source getSource()
          Returns the Source.
 String getSourceIdentifier()
          Returns the source asserted unique identifier (MAPSID).
 String getSubsetId()
          Shorthand for getSubsetIdentifier().
 String getSubsetIdentifier()
          Returns the subset identifier (MAPSUBSETID).
 MapObject getTo()
          Returns the mapped to MapObject.
 String getType()
          Returns the type of mapping (MAPTYPE).
 int hashCode()
          Return a hash code based on key fields.
 void setAdditionalRelationshipLabel(AdditionalRelationshipLabel rela)
          Sets the AdditionalRelationshipLabel (RELA).
 void setAttributeName(AttributeName atn)
          Sets the AttributeName (MAPATN).
 void setAttributeValue(String atv)
          Sets the attribute value (MAPATV).
 void setConcept(Concept concept)
          Sets the Concept that holds this Mapping (CUI).
 void setContentView(ContentView cvf)
          Sets tbe ContentView definition for this Mapping (CVF).
 void setCvf(ContentView cvf)
          Shorthand for setContentView(ContentView).
 void setFrom(MapObject from)
          Sets the mapped from MapObject.
 void setId(String id)
          Sets the unique identifier (MAPID).
 void setIdentifier(String id)
          Sets the unique identifier (MAPID).
 void setRank(String rank)
          Sets the rank (RANK).
 void setRel(RelationshipLabel rel)
          Shorthand for setRelationshipName(RelationshipLabel).
 void setRela(AdditionalRelationshipLabel rela)
          Shorthand for setAdditionalRelationshipLabel(AdditionalRelationshipLabel).
 void setRelationshipName(RelationshipLabel rel)
          Sets the RelationshipLabel (REL).
 void setRes(String res)
          Sets the human readable rule for use of mapping (MAPRES).
 void setRestriction(String res)
          Sets the human readable rule for use of mapping (MAPRES).
 void setRule(String rule)
          Sets the machine processable rule for when to apply mapping (MAPRULE).
 void setSid(String sid)
          Sets the source asserted unique identifier (MAPSID).
 void setSource(Source source)
          Sets the Source.
 void setSourceIdentifier(String sid)
          Sets the source asserted unique identifier (MAPSID).
 void setSubsetId(String subsetid)
          Shorthand for setSubsetIdentifier(String).
 void setSubsetIdentifier(String subsetid)
          Sets the subset identifier (MAPSUBSETID).
 void setTo(MapObject to)
          Sets the mapped to MapObject.
 void setType(String type)
          Sets the type of mapping (MAPTYPE).
 
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

MappingImpl

public MappingImpl()
Instantiates an empty MappingImpl.


MappingImpl

public MappingImpl(Mapping mapping)
Instantiates a Mapping from the specified Mapping.

Parameters:
mapping - the Mapping to copy
Method Detail

getConcept

public Concept getConcept()
Returns the Concept that holds this Mapping (CUI).

Specified by:
getConcept in interface ConceptElement
Returns:
the Concept that holds this Mapping

setConcept

public void setConcept(Concept concept)
Sets the Concept that holds this Mapping (CUI).

Specified by:
setConcept in interface ConceptElement
Parameters:
concept - the Concept that holds this Mapping

getRel

public RelationshipLabel getRel()
Shorthand for getRelationshipName().

Specified by:
getRel in interface Mapping
Returns:
the result of getRelationshipName()

setRel

public void setRel(RelationshipLabel rel)
Shorthand for setRelationshipName(RelationshipLabel).

Specified by:
setRel in interface Mapping
Parameters:
rel - the RelationshipLabel

getRelationshipName

public RelationshipLabel getRelationshipName()
Returns the RelationshipLabel (REL).

Specified by:
getRelationshipName in interface Mapping
Returns:
the RelationshipLabel

setRelationshipName

public void setRelationshipName(RelationshipLabel rel)
Sets the RelationshipLabel (REL).

Specified by:
setRelationshipName in interface Mapping
Parameters:
rel - the RelationshipLabel

getAdditionalRelationshipLabel

public AdditionalRelationshipLabel getAdditionalRelationshipLabel()
Returns the AdditionalRelationshipLabel (RELA).

Specified by:
getAdditionalRelationshipLabel in interface Mapping
Returns:
the AdditionalRelationshipLabel

getRela

public AdditionalRelationshipLabel getRela()
Shorthand for getAdditionalRelationshipLabel().

Specified by:
getRela in interface Mapping
Returns:
the result of getAdditionalRelationshipLabel()

setAdditionalRelationshipLabel

public void setAdditionalRelationshipLabel(AdditionalRelationshipLabel rela)
Sets the AdditionalRelationshipLabel (RELA).

Specified by:
setAdditionalRelationshipLabel in interface Mapping
Parameters:
rela - the AdditionalRelationshipLabel

setRela

public void setRela(AdditionalRelationshipLabel rela)
Shorthand for setAdditionalRelationshipLabel(AdditionalRelationshipLabel).

Specified by:
setRela in interface Mapping
Parameters:
rela - the AdditionalRelationshipLabel

getFrom

public MapObject getFrom()
Returns the mapped from MapObject.

Specified by:
getFrom in interface Mapping
Returns:
the mapped from MapObject

setFrom

public void setFrom(MapObject from)
Sets the mapped from MapObject.

Specified by:
setFrom in interface Mapping
Parameters:
from - the mapped from MapObject

getTo

public MapObject getTo()
Returns the mapped to MapObject.

Specified by:
getTo in interface Mapping
Returns:
the mapped to MapObject

setTo

public void setTo(MapObject to)
Sets the mapped to MapObject.

Specified by:
setTo in interface Mapping
Parameters:
to - the mapped to MapObject

getSubsetIdentifier

public String getSubsetIdentifier()
Returns the subset identifier (MAPSUBSETID).

Specified by:
getSubsetIdentifier in interface Mapping
Returns:
the subset identifier

getSubsetId

public String getSubsetId()
Shorthand for getSubsetIdentifier().

Specified by:
getSubsetId in interface Mapping
Returns:
the result of getSubsetIdentifier()

setSubsetIdentifier

public void setSubsetIdentifier(String subsetid)
Sets the subset identifier (MAPSUBSETID).

Specified by:
setSubsetIdentifier in interface Mapping
Parameters:
subsetid - subset identifier

setSubsetId

public void setSubsetId(String subsetid)
Shorthand for setSubsetIdentifier(String).

Specified by:
setSubsetId in interface Mapping
Parameters:
subsetid - subset identifier

getRank

public String getRank()
Returns the rank (RANK).

Specified by:
getRank in interface Mapping
Returns:
the rank

setRank

public void setRank(String rank)
Sets the rank (RANK).

Specified by:
setRank in interface Mapping
Parameters:
rank - priority

getSourceIdentifier

public String getSourceIdentifier()
Returns the source asserted unique identifier (MAPSID).

Specified by:
getSourceIdentifier in interface Mapping
Returns:
the source asserted unique identifier

setSourceIdentifier

public void setSourceIdentifier(String sid)
Sets the source asserted unique identifier (MAPSID).

Specified by:
setSourceIdentifier in interface Mapping
Parameters:
sid - source asserted unique identifier

getSid

public String getSid()
Returns the source asserted unique identifier (MAPSID). This method is shorthand for getSourceIdentifier().

Specified by:
getSid in interface Mapping
Returns:
the source asserted unique identifier

setSid

public void setSid(String sid)
Sets the source asserted unique identifier (MAPSID). This method is shorthand for setSourceIdentifier(String).

Specified by:
setSid in interface Mapping
Parameters:
sid - source asserted unique identifier

getIdentifier

public String getIdentifier()
Returns the unique identifier (MAPID).

Specified by:
getIdentifier in interface Mapping
Returns:
the unique identifier

setIdentifier

public void setIdentifier(String id)
Sets the unique identifier (MAPID).

Specified by:
setIdentifier in interface Mapping
Parameters:
id - unique identifier

getId

public String getId()
Returns the unique identifier (MAPID). This method is shorthand for getIdentifier().

Specified by:
getId in interface Mapping
Returns:
the unique identifier

setId

public void setId(String id)
Sets the unique identifier (MAPID). This method is shorthand for setIdentifier(String).

Specified by:
setId in interface Mapping
Parameters:
id - unique identifier

getRule

public String getRule()
Returns the machine processable rule for when to apply mapping (MAPRULE).

Specified by:
getRule in interface Mapping
Returns:
the rule

setRule

public void setRule(String rule)
Sets the machine processable rule for when to apply mapping (MAPRULE).

Specified by:
setRule in interface Mapping
Parameters:
rule - rule for when to apply mapping

getRestriction

public String getRestriction()
Returns the human readable rule for use of mapping (MAPRES).

Specified by:
getRestriction in interface Mapping
Returns:
the map restriction

setRestriction

public void setRestriction(String res)
Sets the human readable rule for use of mapping (MAPRES).

Specified by:
setRestriction in interface Mapping
Parameters:
res - String

getRes

public String getRes()
Returns the human readable rule for use of mapping (MAPRES). This is shorthand for getRestriction().

Specified by:
getRes in interface Mapping
Returns:
the human readable rule for use of mapping

setRes

public void setRes(String res)
Sets the human readable rule for use of mapping (MAPRES). This is shorthand for setRestriction(String).

Specified by:
setRes in interface Mapping
Parameters:
res - the human readable rule for use of mapping

getAttributeName

public AttributeName getAttributeName()
Returns the AttributeName (MAPATN).

Specified by:
getAttributeName in interface Mapping
Returns:
the AttributeName

setAttributeName

public void setAttributeName(AttributeName atn)
Sets the AttributeName (MAPATN).

Specified by:
setAttributeName in interface Mapping
Parameters:
atn - the AttributeName

getAttributeValue

public String getAttributeValue()
Returns the attribute value (MAPATV).

Specified by:
getAttributeValue in interface Mapping
Returns:
the attribute value

setAttributeValue

public void setAttributeValue(String atv)
Sets the attribute value (MAPATV).

Specified by:
setAttributeValue in interface Mapping
Parameters:
atv - the attribute value

getSource

public Source getSource()
Returns the Source.

Specified by:
getSource in interface SourceElement
Returns:
the source

setSource

public void setSource(Source source)
Sets the Source.

Specified by:
setSource in interface SourceElement
Parameters:
source - the source

getType

public String getType()
Returns the type of mapping (MAPTYPE).

Specified by:
getType in interface Mapping
Returns:
the type of mapping

setType

public void setType(String type)
Sets the type of mapping (MAPTYPE).

Specified by:
setType in interface Mapping
Parameters:
type - the type of mapping

getContentView

public ContentView getContentView()
Returns tbe ContentView definition for this Mapping (CVF).

Specified by:
getContentView in interface ContentViewElement
Returns:
tbe ContentView definition

setContentView

public void setContentView(ContentView cvf)
Sets tbe ContentView definition for this Mapping (CVF).

Specified by:
setContentView in interface ContentViewElement
Parameters:
cvf - the ContentView definition

getCvf

public ContentView getCvf()
Shorthand for getContentView().

Specified by:
getCvf in interface ContentViewElement
Returns:
the result of getContentView()

setCvf

public void setCvf(ContentView cvf)
Shorthand for setContentView(ContentView).

Specified by:
setCvf in interface ContentViewElement
Parameters:
cvf - the ContentView definition

getKeyFields

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

Specified by:
getKeyFields in interface Mapping
Returns:
a String composed from the mapsetcui, mapsetsab, mapsubsetid, maprank, from fields, rel, rela, to fields, maprule, maptype, mapatn, mapatv, cvf fields

hashCode

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

Returns:
a hash code based on key fields

equals

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

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

compareTo

public int compareTo(Object o)
Compares this Mapping to another one. Results are indeterminate if the specified parameter is not of the same class.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to compare to
Returns:
int representing the relative ordering of this and the compare-to object


Copyright ©2005