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

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.TermAttributeImpl
All Implemented Interfaces:
Comparable, ConceptElement, TermAttribute, TermElement

public class TermAttributeImpl
extends Object
implements TermAttribute

Default implementation of the TermAttribute interface.

Author:
Brian Carlsen, Deborah Shapiro

Constructor Summary
TermAttributeImpl()
          Instantiates an empty TermAttribute.
TermAttributeImpl(TermAttribute ta)
          Instantiates a TermAttribute from the specified TermAttribute.
 
Method Summary
 void addStringAttribute(StringAttribute sa)
          Adds the specified StringAttribute.
 void clearStringAttributes()
          Removes all StringAttributes.
 int compareTo(Object o)
          Compares this TermAttribute to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 Concept getConcept()
          Returns the Concept that holds this TermAttribute.
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 String getLui()
          Shorthand for getTermIdentifier().
 StringAttribute[] getStringAttributes()
          Returns all StringAttributes.
 List getStringAttributesAsList()
          Returns all StringAttributes as a List.
 Term getTerm()
          Returns the Term.
 String getTermIdentifier()
          Returns the term identifier (LUI).
 int hashCode()
          Return a hash code based on key fields.
 void removeStringAttribute(StringAttribute sa)
          Removes the specified StringAttribute.
 void setConcept(Concept concept)
          Sets the Concept that holds this TermAttribute.
 void setLui(String lui)
          Shorthand for setTermIdentifier(String).
 void setStringAttributes(List sa)
          Replaces the StringAttributes with the ones in the specified List.
 void setStringAttributes(StringAttribute[] sa)
          Replaces the StringAttributes with the ones in the specified array.
 void setTerm(Term term)
          Sets the Term to which this TermAttribute refers.
 void setTermIdentifier(String lui)
          Sets the term identifier (LUI).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermAttributeImpl

public TermAttributeImpl()
Instantiates an empty TermAttribute.


TermAttributeImpl

public TermAttributeImpl(TermAttribute ta)
Instantiates a TermAttribute from the specified TermAttribute.

Parameters:
ta - TermAttribute to be copied
Method Detail

getTerm

public Term getTerm()
Returns the Term.

Specified by:
getTerm in interface TermElement
Returns:
Term

setTerm

public void setTerm(Term term)
Sets the Term to which this TermAttribute refers.

Specified by:
setTerm in interface TermElement
Parameters:
term - Term to which this TermAttribute refers

getLui

public String getLui()
Shorthand for getTermIdentifier().

Specified by:
getLui in interface TermAttribute
Returns:
the LUI

setLui

public void setLui(String lui)
Shorthand for setTermIdentifier(String).

Specified by:
setLui in interface TermAttribute
Parameters:
lui - the LUI

getTermIdentifier

public String getTermIdentifier()
Returns the term identifier (LUI).

Specified by:
getTermIdentifier in interface TermAttribute
Returns:
the LUI

setTermIdentifier

public void setTermIdentifier(String lui)
Sets the term identifier (LUI).

Specified by:
setTermIdentifier in interface TermAttribute
Parameters:
lui - the LUI

getStringAttributes

public StringAttribute[] getStringAttributes()
Returns all StringAttributes.

Specified by:
getStringAttributes in interface TermAttribute
Returns:
a array of StringAttributes

getStringAttributesAsList

public List getStringAttributesAsList()
Returns all StringAttributes as a List.

Specified by:
getStringAttributesAsList in interface TermAttribute
Returns:
a List of StringAttributes

addStringAttribute

public void addStringAttribute(StringAttribute sa)
Adds the specified StringAttribute.

Specified by:
addStringAttribute in interface TermAttribute
Parameters:
sa - the StringAttribute to be added

removeStringAttribute

public void removeStringAttribute(StringAttribute sa)
Removes the specified StringAttribute.

Specified by:
removeStringAttribute in interface TermAttribute
Parameters:
sa - the StringAttribute to be removed

clearStringAttributes

public void clearStringAttributes()
Removes all StringAttributes.

Specified by:
clearStringAttributes in interface TermAttribute

setStringAttributes

public void setStringAttributes(StringAttribute[] sa)
Replaces the StringAttributes with the ones in the specified array.

Specified by:
setStringAttributes in interface TermAttribute
Parameters:
sa - a StringAttribute[]

setStringAttributes

public void setStringAttributes(List sa)
Replaces the StringAttributes with the ones in the specified List.

Specified by:
setStringAttributes in interface TermAttribute
Parameters:
sa - a List of StringAttributes

getConcept

public Concept getConcept()
Returns the Concept that holds this TermAttribute.

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

setConcept

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

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

getKeyFields

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

Specified by:
getKeyFields in interface TermAttribute
Returns:
a String composed from the cui and lui.

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 an TermAttribute 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 TermAttribute 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