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

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.MapObjectImpl
All Implemented Interfaces:
Comparable, MapObject, SourceElement

public class MapObjectImpl
extends Object
implements MapObject

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
MapObjectImpl()
          Instantiates an empty MappingImpl.
MapObjectImpl(MapObject mapping)
          Instantiates a MapObject from the specified MapObject.
 
Method Summary
 int compareTo(Object o)
          Compares this MapObject with the specified object for order.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 String getExpr()
          Returns the expression (FROMEXPR or TOEXPR).
 String getExpression()
          Returns the expression (FROMEXPR or TOEXPR).
 String getId()
          Returns the unique identifier (FROMID or TOID).
 String getIdentifier()
          Returns the unique identifier (FROMID or TOID).
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 String getRes()
          Returns the restriction (FROMRES or TORES).
 String getRestriction()
          Returns the restriction (FROMRES or TORES).
 String getRule()
          Returns the machine processable rule for when mapping is valid (FROMRULE or TORULE).
 String getSid()
          Returns the source asserted unique identifier (FROMSID or TOSID).
 Source getSource()
          Returns the source for this MapObject.
 String getSourceIdentifier()
          Returns the source asserted unique identifier (FROMSID or TOSID).
 SourceIdentifierType getType()
          Returns the type SourceIdentifierType (FROMTYPE or TOTYPE).
 int hashCode()
          Returns a hash code based on key fields.
 void setExpr(String expr)
          Sets the expression (FROMEXPR or TOEXPR).
 void setExpression(String expr)
          Sets the expression (FROMEXPR or TOEXPR).
 void setId(String id)
          Sets the unique identifier (FROMID or TOID).
 void setIdentifier(String id)
          Sets the unique identifier (FROMID or TOID).
 void setRes(String res)
          Sets the restriction (FROMRES or TORES).
 void setRestriction(String res)
          Sets the restriction (FROMRES or TORES).
 void setRule(String rule)
          Sets the machine processable rule for when mapping is valid (FROMRULE or TORULE).
 void setSid(String sid)
          Sets the source asserted unique identifier (FROMSID or TOSID).
 void setSource(Source source)
          Sets the source for this MapObject.
 void setSourceIdentifier(String sid)
          Sets the source asserted unique identifier (FROMSID or TOSID).
 void setType(SourceIdentifierType type)
          Sets the type (FROMTYPE or TOTYPE).
 
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

MapObjectImpl

public MapObjectImpl()
Instantiates an empty MappingImpl.


MapObjectImpl

public MapObjectImpl(MapObject mapping)
Instantiates a MapObject from the specified MapObject.

Parameters:
mapping - the MapObject to copy
Method Detail

getSourceIdentifier

public String getSourceIdentifier()
Returns the source asserted unique identifier (FROMSID or TOSID).

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

setSourceIdentifier

public void setSourceIdentifier(String sid)
Sets the source asserted unique identifier (FROMSID or TOSID).

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

getSid

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

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

setSid

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

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

getIdentifier

public String getIdentifier()
Returns the unique identifier (FROMID or TOID).

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

setIdentifier

public void setIdentifier(String id)
Sets the unique identifier (FROMID or TOID).

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

getId

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

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

setId

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

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

getExpression

public String getExpression()
Returns the expression (FROMEXPR or TOEXPR).

Specified by:
getExpression in interface MapObject
Returns:
the expression

setExpression

public void setExpression(String expr)
Sets the expression (FROMEXPR or TOEXPR).

Specified by:
setExpression in interface MapObject
Parameters:
expr - expression

getExpr

public String getExpr()
Returns the expression (FROMEXPR or TOEXPR). This method is shorthand for getExpression().

Specified by:
getExpr in interface MapObject
Returns:
the expression

setExpr

public void setExpr(String expr)
Sets the expression (FROMEXPR or TOEXPR). This method is shorthand for setExpression(String).

Specified by:
setExpr in interface MapObject
Parameters:
expr - expression

getType

public SourceIdentifierType getType()
Returns the type SourceIdentifierType (FROMTYPE or TOTYPE).

Specified by:
getType in interface MapObject
Returns:
the type

setType

public void setType(SourceIdentifierType type)
Sets the type (FROMTYPE or TOTYPE).

Specified by:
setType in interface MapObject
Parameters:
type - SourceIdentifierType

getRule

public String getRule()
Returns the machine processable rule for when mapping is valid (FROMRULE or TORULE).

Specified by:
getRule in interface MapObject
Returns:
the rule

setRule

public void setRule(String rule)
Sets the machine processable rule for when mapping is valid (FROMRULE or TORULE).

Specified by:
setRule in interface MapObject
Parameters:
rule - the rule

getRestriction

public String getRestriction()
Returns the restriction (FROMRES or TORES).

Specified by:
getRestriction in interface MapObject
Returns:
the restriction

setRestriction

public void setRestriction(String res)
Sets the restriction (FROMRES or TORES).

Specified by:
setRestriction in interface MapObject
Parameters:
res - restriction

getRes

public String getRes()
Returns the restriction (FROMRES or TORES). This method is shorthand for getRestriction().

Specified by:
getRes in interface MapObject
Returns:
the restriction

setRes

public void setRes(String res)
Sets the restriction (FROMRES or TORES). This method is shorthand for setRestriction(String).

Specified by:
setRes in interface MapObject
Parameters:
res - restriction

getSource

public Source getSource()
Returns the source for this MapObject.

Specified by:
getSource in interface SourceElement
Returns:
Source

setSource

public void setSource(Source source)
Sets the source for this MapObject.

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

getKeyFields

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

Specified by:
getKeyFields in interface MapObject
Returns:
a String composed from the ui, expr, type, rule, restriction and source fields

equals

public boolean equals(Object o)
Returns true if the specified object is equal to this object. The specified object must be a MapObject 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 MapObject 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