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

java.lang.Object
  extended by it.unimi.dico.islab.idbs2.cloud.Resource

public class Resource
extends Object

Representation of a resource to be associated with a node. This resource is in fact a connection between a CloudNode and a KnowledgeChunk, the latter represented by it's id (due to the separation of the knowledge chunk database and the cloud database).

Author:
Vegeziel
See Also:
KnowledgeChunk

Constructor Summary
protected Resource(CloudNode node, String resId, Double relevance)
          Direct use of this constructor is discouraged.
 
Method Summary
 CloudNode getNode()
          Get the owner CloudNode.
 Double getRelevance()
          Get the relevance of this resource for this node.
 String getResourceId()
          Get the id of the connected resource represented by this class.
protected  void setNode(CloudNode node)
          Set the identifier of the owner node.
 void setRelevance(Double relevance)
          Set the relevance of this resource for this node.
protected  void setResourceId(String resourceId)
          Set the id of the connected resource represented by this class.
 String toString()
          Returns a string representation of this resource as the id of the referred KnowledgeChunk with additional information about it's relevance in this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Resource

protected Resource(CloudNode node,
                   String resId,
                   Double relevance)
Direct use of this constructor is discouraged. Use the CloudNode.addResource method instead.

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

toString

public String toString()
Returns a string representation of this resource as the id of the referred KnowledgeChunk with additional information about it's relevance in this node.

Overrides:
toString in class Object

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.


getResourceId

public String getResourceId()
Get the id of the connected resource represented by this class.

Returns:
the id of the resource (id of the associated KnowledgeChunk
See Also:
KnowledgeChunk

setResourceId

protected void setResourceId(String resourceId)
Set the id of the connected resource represented by this class.

Parameters:
resourceId - the id of the resource (id of the associated KnowledgeChunk
See Also:
KnowledgeChunk

getRelevance

public Double getRelevance()
Get the relevance of this resource for this node.

Returns:
relevance of this resource.

setRelevance

public void setRelevance(Double relevance)
Set the relevance of this resource for this node.

Parameters:
relevance - the relevance of this resource.