gov.nih.nlm.mms.browser
Class DisplayableConcept

java.lang.Object
  extended by gov.nih.nlm.umls.meta.impl.PlaceholderConcept
      extended by gov.nih.nlm.umls.meta.impl.ConceptImpl
          extended by gov.nih.nlm.mms.browser.DisplayableConcept
All Implemented Interfaces:
Concept, Comparable

public class DisplayableConcept
extends ConceptImpl
implements Comparable

Extension of Concept to support a configurable display name.


Nested Class Summary
 
Nested classes/interfaces inherited from interface gov.nih.nlm.umls.meta.Concept
Concept.ByCUIComparator, Concept.ByPreferredNameComparator
 
Field Summary
 
Fields inherited from class gov.nih.nlm.umls.meta.impl.ConceptImpl
attributes, component_histories, contexts, coocurrences, definitions, locators, mappings, relationships, semantic_types
 
Fields inherited from class gov.nih.nlm.umls.meta.impl.PlaceholderConcept
atoms, cui
 
Constructor Summary
DisplayableConcept(Concept concept, Language lat, double sortKey)
          Instantiates a DisplayableConcept from the specified Concept
DisplayableConcept(Concept concept, Language lat, String sortKey)
          Instantiates a DisplayableConcept from the specified Concept
 
Method Summary
 int compareTo(Object o)
          Compares two DisplayableConcepts for order.
 String getPreferredName()
          Returns the preferred name of the concept.
 String getSortKey()
          Returns the score for this DisplayableConcept.
 void setSortKey(double sortKey)
          Sets the score for this DisplayableConcept.
 void setSortKey(String sortKey)
          Sets the score for this DisplayableConcept.
 String toString()
          Returns a String representation of the concept based on the prefererd name.
 
Methods inherited from class gov.nih.nlm.umls.meta.impl.ConceptImpl
addAtom, addAttribute, addComponentHistory, addContext, addCoocurrence, addDefinition, addLocator, addMapping, addRelationship, addSemanticType, clear, clearAtoms, clearAttributes, clearComponentHistories, clearContexts, clearCoocurrences, clearDefinitions, clearLocators, clearMappings, clearRelationships, clearSemanticTypes, getAtoms, getAtoms, getAtomsAsList, getAttributes, getAttributesAsList, getAttributesForAtom, getAttributesForAtomAsList, getAttributesForRelationship, getAttributesForRelationshipAsList, getComponentHistories, getComponentHistoriesAsList, getConceptIdentifier, getContextGroups, getContextGroupsAsList, getContexts, getContexts, getContextsAsList, getCoocurrenceGroups, getCoocurrenceGroupsAsList, getCoocurrences, getCoocurrences, getCoocurrencesAsList, getCui, getDefinitions, getDefinitions, getDefinitionsAsList, getKeyFields, getLocators, getLocatorsAsList, getMappings, getMappingsAsList, getPreferredAtom, getPreferredAtom, getRelationships, getRelationships, getRelationshipsAsList, getSemanticTypes, getSemanticTypesAsList, getTermAttributes, getTermAttributesAsList, getTerms, getTermsAsList, isEmpty, removeAtom, removeAtom, removeAttribute, removeAttribute, removeComponentHistory, removeContext, removeContext, removeCoocurrence, removeCoocurrence, removeDefinition, removeLocator, removeMapping, removeMapping, removeRelationship, removeRelationship, removeSemanticType, setAtoms, setAtoms, setAttributes, setAttributes, setComponentHistories, setComponentHistories, setConceptIdentifier, setContexts, setContexts, setCoocurrences, setCoocurrences, setCui, setDefinitions, setDefinitions, setLocators, setLocators, setMappings, setMappings, setRelationships, setRelationships, setSemanticTypes, setSemanticTypes
 
Methods inherited from class gov.nih.nlm.umls.meta.impl.PlaceholderConcept
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisplayableConcept

public DisplayableConcept(Concept concept,
                          Language lat,
                          String sortKey)
Instantiates a DisplayableConcept from the specified Concept

Parameters:
concept - the Concept
lat - language abbreviation
sortKey - the sort key

DisplayableConcept

public DisplayableConcept(Concept concept,
                          Language lat,
                          double sortKey)
Instantiates a DisplayableConcept from the specified Concept

Parameters:
concept - the Concept
lat - language abbreviation
sortKey - the sort key
Method Detail

getSortKey

public String getSortKey()
Returns the score for this DisplayableConcept.

Returns:
the score for this DisplayableConcept

setSortKey

public void setSortKey(String sortKey)
Sets the score for this DisplayableConcept.

Parameters:
score -

setSortKey

public void setSortKey(double sortKey)
Sets the score for this DisplayableConcept.

Parameters:
score -

getPreferredName

public String getPreferredName()
Returns the preferred name of the concept.

Returns:
the preferred name of the concept

toString

public String toString()
Returns a String representation of the concept based on the prefererd name.

Overrides:
toString in class Object
Returns:
a String representation of the concept

compareTo

public int compareTo(Object o)
Compares two DisplayableConcepts for order. Returns a negative integer, zero, or a positive integer as the first DisplayableConcept has a higher, equal, or lower score than the second. If two DisplayableConcepts have the same score then the method returns a negative integer, zero, or a positive integer as the first one's CUI is less than, equal to, or greater than the second.

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class PlaceholderConcept
Parameters:
o1 - the first object to be compared.
o2 - the second object to be compared.
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Throws:
ClassCastException - if the arguments' types prevent them from being compared by this Comparator.


Copyright ©2005