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

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

public class EsType
extends Object
implements Comparable<EsType>

Representation of an essential's type 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 EsType(CloudNode node, String classId, Double relevance)
          Direct use of this constructor is discouraged.
 
Method Summary
 int compareTo(EsType o)
          Implementation of a comparison value between two EsType objects considering the relevance of the types.
 boolean equals(Object obj)
          Evaluates the equality between the current object and the one passed as argument.
 String getClassId()
          Get current type identifier (an EsType is actually an association between a Type and a CloudNode).
 Integer getId()
          Get current essential-type identifier (database purposes only)
 CloudNode getNode()
          Get the owner CloudNode.
 Double getRelevance()
          Get current type relevance.
 int hashCode()
          Returns the hashCode of the contained classId.
protected  void setClassId(String classId)
           Set current term identifier.
protected  void setNode(CloudNode node)
          Set the identifier of the owner node.
 void setRelevance(Double relevance)
          Set current type relevance.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EsType

protected EsType(CloudNode node,
                 String classId,
                 Double relevance)
Direct use of this constructor is discouraged. Use the CloudNode.addEsType method instead.

Parameters:
node - the owner cluster of this type.
classId - the identifier of the corresponding KC database type(an EsType is actually an association between a Type and a CloudNode).
relevance - the relevance value associated with this type.
See Also:
CloudNode.addEsType(String, Double), Type
Method Detail

getClassId

public String getClassId()

Get current type identifier (an EsType is actually an association between a Type and a CloudNode).

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

setClassId

protected void setClassId(String classId)

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


getRelevance

public Double getRelevance()

Get current type relevance.

Returns:
current type relevance value.

setRelevance

public void setRelevance(Double relevance)

Set current type relevance.

Parameters:
relevance - current type relevance value.

getId

public Integer getId()

Get current essential-type identifier (database purposes only)

Returns:
current esType identifier.

getNode

public CloudNode getNode()

Get the owner CloudNode.

Returns:
the owner CloudNode.

setNode

protected 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 EsType class and this classId is equal to the given object's classId.
  • false otherwise

hashCode

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

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

compareTo

public int compareTo(EsType o)

Implementation of a comparison value between two EsType objects considering the relevance of the types.

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

toString

public String toString()
Overrides:
toString in class Object