it.unimi.dico.islab.idbs2.kc
Class Term

java.lang.Object
  extended by it.unimi.dico.islab.idbs2.kc.Term

public class Term
extends Object

Representation of a keyword of a KnowledgeChunk with associated relevance and frequency. This is in fact an association between a keyword and a knowledge chunk from which the keyword has been extracted. The same keyword could appear in more than one Term instance, every time connected with different KnowledgeChunks and, possibly, different frequency and relevance.

The following image shows the relations between the fields of this object and the fields of the wrapped database table (fields with the same color represents a mapping between relational schema and the corresponding object).


Author:
Vegeziel
See Also:
KnowledgeChunk

Constructor Summary
protected Term()
          Only Hibernate and KnowledgeChunk are able to instantiate this object.
protected Term(KnowledgeChunk kc, String value, double relevance, Integer frequency)
          Direct use of this constructor is discouraged.
 
Method Summary
 boolean equals(Object obj)
           
 Integer getFrequency()
          Getter for the frequency field.
 Integer getId()
          Getter for the identifier of this object in the linked database.
 KnowledgeChunk getKc()
           Getter for the kc field.
 Double getRelevance()
           Getter for the relevance field.
 String getValue()
          Getter for the keyword value.
 int hashCode()
           
 void setFrequency(Integer frequency)
          Setter for the frequency field.
protected  void setId(Integer id)
           Method used by Hibernate to import database objects.
 void setKc(KnowledgeChunk kc)
          Setter for the kc field.
 void setRelevance(Double relevance)
           Setter for the relevance field.
protected  void setValue(String termValue)
          Setter for the keyword value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Term

protected Term()
Only Hibernate and KnowledgeChunk are able to instantiate this object. Direct use is discouraged.


Term

protected Term(KnowledgeChunk kc,
               String value,
               double relevance,
               Integer frequency)

Direct use of this constructor is discouraged. Use KnowledgeChunk.addTerm instead.

Parameters:
kc - the belonging KnowledgeChunk
value - the real term in string representation.
relevance - the relevance of this keyword(term) for kc
frequency - the frequency of this keyword(term) for kc
See Also:
KnowledgeChunk.addTerm(String, Double, Integer)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getValue

public String getValue()

Getter for the keyword value.

Returns:
a string representing the keyword wrapped by this Term instance.

setValue

protected void setValue(String termValue)

Setter for the keyword value.

Parameters:
termValue - a string representing the keyword wrapped by this Term instance.

getId

public Integer getId()

Getter for the identifier of this object in the linked database.

Returns:
the id of the term_eq relation.

setId

protected void setId(Integer id)

Method used by Hibernate to import database objects. Direct use is discouraged.

Parameters:
id -

getFrequency

public Integer getFrequency()

Getter for the frequency field.

Returns:
the frequency of this term wrapper as the number of its occurrences in kc.

setFrequency

public void setFrequency(Integer frequency)

Setter for the frequency field.

Parameters:
frequency - the frequency of this term wrapper as the number of its occurrences in kc.

getKc

public KnowledgeChunk getKc()

Getter for the kc field.

Returns:
the kc owner of the value keyword.

setKc

public void setKc(KnowledgeChunk kc)

Setter for the kc field.

Parameters:
kc - the kc owner of the value keyword.

setRelevance

public void setRelevance(Double relevance)

Setter for the relevance field.

Parameters:
relevance - the relevance of the wrapped term for the kc.

getRelevance

public Double getRelevance()

Getter for the relevance field.

Returns:
the relevance of the wrapped term for the kc.