org.openmrs
Class ConceptWord

java.lang.Object
  extended by org.openmrs.ConceptWord
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ConceptWord>

public class ConceptWord
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<ConceptWord>

ConceptWord Concept words are the individual terms of which a concept name is composed. They are case-preserving but compare case insensitively.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
ConceptWord()
          default constructor
ConceptWord(Concept c, ConceptName conceptName)
           
ConceptWord(java.lang.String word, Concept concept, ConceptName conceptName, java.util.Locale locale)
          Convenience constructor
ConceptWord(java.lang.String word, Concept concept, ConceptName conceptName, java.util.Locale locale, java.lang.String synonym)
          Deprecated. see ConceptWord(String, Concept, ConceptName, Locale)
 
Method Summary
 int compareTo(ConceptWord word)
           
 boolean equals(java.lang.Object obj)
           
 Concept getConcept()
           
 ConceptName getConceptName()
           
 java.lang.Integer getConceptWordId()
          Get the unique internal database identifier for this concept word
 java.util.Locale getLocale()
           
 java.lang.String getSynonym()
          Deprecated. this value is not stored anymore
static java.util.List<java.lang.String> getUniqueWords(java.lang.String phrase)
          Split the given phrase on words and remove unique and stop words
 java.lang.Double getWeight()
           
 java.lang.String getWord()
           
 int hashCode()
           
 void increaseWeight(java.lang.Double i)
          Increment the weight by i
static java.util.Set<ConceptWord> makeConceptWords(Concept concept)
           
 void setConcept(Concept concept)
           
 void setConceptName(ConceptName conceptName)
          Sets the concept name associated with this word.
 void setConceptWordId(java.lang.Integer conceptWordId)
          Set the unique identifier for this concept word
 void setLocale(java.util.Locale locale)
           
 void setSynonym(java.lang.String synonym)
          Deprecated. this value is not stored anymore
 void setWeight(java.lang.Double weight)
           
 void setWord(java.lang.String word)
           
static java.lang.String[] splitPhrase(java.lang.String phrase)
          Split words according to OpenmrsConstants.REGEXes, newlines, and spaces
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ConceptWord

public ConceptWord()
default constructor


ConceptWord

public ConceptWord(java.lang.String word,
                   Concept concept,
                   ConceptName conceptName,
                   java.util.Locale locale)
Convenience constructor

Parameters:
word - the single word that will be matched to search terms
concept - the concept that is being matched to
conceptName - the specific name that will be matched
locale - the locale that is being pulled from

ConceptWord

@Deprecated
public ConceptWord(java.lang.String word,
                              Concept concept,
                              ConceptName conceptName,
                              java.util.Locale locale,
                              java.lang.String synonym)
Deprecated. see ConceptWord(String, Concept, ConceptName, Locale)


ConceptWord

public ConceptWord(Concept c,
                   ConceptName conceptName)
Method Detail

getConceptWordId

public java.lang.Integer getConceptWordId()
Get the unique internal database identifier for this concept word

Since:
1.5

setConceptWordId

public void setConceptWordId(java.lang.Integer conceptWordId)
Set the unique identifier for this concept word

Since:
1.5

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

getLocale

public java.util.Locale getLocale()
Returns:
Returns the locale.

setLocale

public void setLocale(java.util.Locale locale)
Parameters:
locale - The locale to set.

getSynonym

@Deprecated
public java.lang.String getSynonym()
Deprecated. this value is not stored anymore

Returns:
Returns the synonym.

setSynonym

@Deprecated
public void setSynonym(java.lang.String synonym)
Deprecated. this value is not stored anymore

Parameters:
synonym - The synonym to set.

getWord

public java.lang.String getWord()
Returns:
Returns the word.

setWord

public void setWord(java.lang.String word)
Parameters:
word - The word to set.

getConcept

public Concept getConcept()
Returns:
Returns the concept.

setConcept

public void setConcept(Concept concept)
Parameters:
concept - The concept to set.

setConceptName

public void setConceptName(ConceptName conceptName)
Sets the concept name associated with this word.

Parameters:
conceptName -

getConceptName

public ConceptName getConceptName()
Returns:
Returns the concept name from which this word was derived.

getWeight

public java.lang.Double getWeight()
Returns:
Returns the weight.

setWeight

public void setWeight(java.lang.Double weight)
Parameters:
weight - The weight to set.

increaseWeight

public void increaseWeight(java.lang.Double i)
Increment the weight by i

Parameters:
i -

makeConceptWords

public static java.util.Set<ConceptWord> makeConceptWords(Concept concept)
Parameters:
concept - The concept from which to make the list of concept words.
Returns:
Returns a list of unique concept words based on the specified concept.
Expected behavior:
return separate ConceptWord objects for the same word in different ConceptNames, not include voided names

getUniqueWords

public static java.util.List<java.lang.String> getUniqueWords(java.lang.String phrase)
Split the given phrase on words and remove unique and stop words

Parameters:
phrase -
Returns:
Returns a list of the unique parts of the phrase, in all upper case.

splitPhrase

public static java.lang.String[] splitPhrase(java.lang.String phrase)
Split words according to OpenmrsConstants.REGEXes, newlines, and spaces

Parameters:
phrase -
Returns:
String[] array of words

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

compareTo

public int compareTo(ConceptWord word)
Specified by:
compareTo in interface java.lang.Comparable<ConceptWord>
See Also:
Comparable.compareTo(java.lang.Object)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change