it.unimi.dico.islab.idbs2.cloud
Class EsTerm

java.lang.Object
  extended by it.unimi.dico.islab.idbs2.cloud.EsTerm
All Implemented Interfaces:
Comparable<EsTerm>

public class EsTerm
extends Object
implements Comparable<EsTerm>

Representation of an essential's keyword with associated relevance. See essential concept in it.unimi.dico.islab.db.cloud package for more details.

Author:
Vegeziel
See Also:
CloudNode

Constructor Summary
protected EsTerm(CloudNode node, Integer termId, String value, Double relevance)
          Direct use of this constructor is discouraged.
 
Method Summary
 int compareTo(EsTerm o)
          Implementation of a comparison value between two EsTerm objects considering the relevance of the terms.
 boolean equals(Object obj)
          Evaluates the equality between the current object and the one passed as argument.
 Integer getId()
          Get current essential-term identifier (database purposes only)
 CloudNode getNode()
          Get the owner CloudNode.
 Double getRelevance()
          Get current term relevance.
 Integer getTermId()
          Get current term identifier (an EsTerm is actually an association between a Term and a CloudNode).
 String getTermValue()
          Get current term string representation (real term value)
 int hashCode()
          Returns the hashCode of the contained termValue.
 void setNode(CloudNode node)
          Set the identifier of the owner node.
protected  void setRelevance(Double relevance)
          Set current term relevance.
protected  void setTermId(Integer termId)
           Set current term identifier.
protected  void setTermValue(String termValue)
          Set current term string representation (real term value).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EsTerm

protected EsTerm(CloudNode node,
                 Integer termId,
                 String value,
                 Double relevance)
Direct use of this constructor is discouraged. Use the CloudNode.addEsTerm method instead.

Parameters:
node - the owner cluster of this term.
termId - the identifier of the corresponding KC database term(an EsTerm is actually an association between a Term and a CloudNode).
value - the String value of this term.
relevance - the relevance value associated with this term.
See Also:
CloudNode.addEsTerm(Integer, String, Double)
Method Detail

getTermId

public Integer getTermId()

Get current term identifier (an EsTerm is actually an association between a Term and a CloudNode).

Returns:
the id of the associated Term
See Also:
Term

setTermId

protected void setTermId(Integer termId)

Set current term identifier. To be set using the constructor (direct use is discouraged).


getTermValue

public String getTermValue()

Get current term string representation (real term value)

Returns:
the string value of this term

setTermValue

protected void setTermValue(String termValue)

Set current term string representation (real term value). To be set using the constructor, direct usage is discouraged.

Parameters:
termValue -

getRelevance

public Double getRelevance()

Get current term relevance.

Returns:
current term relevance value.

setRelevance

protected void setRelevance(Double relevance)

Set current term relevance.

Parameters:
relevance - current term relevance value.

getId

public Integer getId()

Get current essential-term identifier (database purposes only)

Returns:
current esTerm identifier.

getNode

public CloudNode getNode()

Get the owner CloudNode.

Returns:
the owner CloudNode.

setNode

public void setNode(CloudNode node)

Set the identifier of the owner node.


equals

public boolean equals(Object obj)
Evaluates the equality between the current object and the one passed as argument.

Overrides:
equals in class Object
Returns:
  • true if the given object is instance of EsTerm class and this termValue is equal to the given object's term value.
  • false otherwise

hashCode

public int hashCode()
Returns the hashCode of the contained termValue.

Overrides:
hashCode in class Object
Returns:
a call to the hashCode method of the String termValue.

compareTo

public int compareTo(EsTerm o)

Implementation of a comparison value between two EsTerm objects considering the relevance of the terms.

Specified by:
compareTo in interface Comparable<EsTerm>
Returns:
the difference between the two EsTerm relevances or, if this difference is 0, the comparison between the two termValue.

toString

public String toString()
Overrides:
toString in class Object