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

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

public class MetaDescriptionImpl
extends Object
implements MetaDescription

Default implementation of the MetaDescription interface. The sole function of this class is to read a line from MRDOC.

Author:
Brian Carlsen, Deborah Shapiro

Field Summary
protected  String key_fields
           
protected  boolean key_fields_flag
           
 
Constructor Summary
MetaDescriptionImpl()
          Instantiates an empty MetaDescriptionImpl.
MetaDescriptionImpl(MetaDescription md)
          This is a copy constructor for MetaDescription.
MetaDescriptionImpl(String mrdoc_row)
          Constructor that takes a row from the MRDOC file.
 
Method Summary
 int compareTo(Object o)
          Compares this MetaDescription to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 String getExplain()
          Returns the explain field.
 String getKey()
          Returns the key.
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 String getType()
          Returns the type.
 String getValue()
          Returns the more detailed description.
 int hashCode()
          Return a hash code based on key fields.
 
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

MetaDescriptionImpl

public MetaDescriptionImpl()
Instantiates an empty MetaDescriptionImpl.


MetaDescriptionImpl

public MetaDescriptionImpl(String mrdoc_row)
Constructor that takes a row from the MRDOC file.

Parameters:
mrdoc_row - row from MRDOC file

MetaDescriptionImpl

public MetaDescriptionImpl(MetaDescription md)
This is a copy constructor for MetaDescription.

Parameters:
md - MetaDescription to be copied
Method Detail

getType

public String getType()
Returns the type.

Specified by:
getType in interface MetaDescription
Returns:
the type

getKey

public String getKey()
Returns the key.

Specified by:
getKey in interface MetaDescription
Returns:
the key

getExplain

public String getExplain()
Returns the explain field.

Specified by:
getExplain in interface MetaDescription
Returns:
the explain field

getValue

public String getValue()
Returns the more detailed description.

Specified by:
getValue in interface MetaDescription
Returns:
the description

getKeyFields

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

Specified by:
getKeyFields in interface MetaDescription
Returns:
a String composed from the key, value, and type.

equals

public boolean equals(Object o)
Returns true if the specified object is equal to this object. The specified object must be a MetaDescription 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()
Return a hash code based on key fields.

Returns:
a hash code based on key fields

compareTo

public int compareTo(Object o)
Compares this MetaDescription 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 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.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.


Copyright ©2005