public class Cloud extends Object
Modifier and Type | Field and Description |
---|---|
static Integer |
EDGE_DEFAULT_WEIGHT |
Modifier | Constructor and Description |
---|---|
protected |
Cloud() |
|
Cloud(boolean isDirect)
Only public constructor to generate a new
Cloud object. |
Modifier and Type | Method and Description |
---|---|
CloudEdge |
addEdge(CloudNode source,
CloudNode target)
This method has the same behavior of
addEdge(CloudNode, CloudNode, double) omitting the weight
parameter and using the default EDGE_DEFAULT_WEIGHT instead. |
CloudEdge |
addEdge(CloudNode source,
CloudNode target,
double weight)
Generates a new edge between two nodes owned by this cloud.
|
CloudNode |
addNode()
Generate and add a new node to this
Cloud . |
CloudEdge |
getEdge(CloudNode source,
CloudNode target)
Grants a quick access (indexed) to the edges map.
|
Set<CloudEdge> |
getEdges()
Get the set of all edges associated with this cloud.
|
Set<CloudEdge> |
getEdges(CloudNode source)
Grants a quick access (indexed) to the edges map to retrieve all the edges having
source as source node. |
Integer |
getId()
Get the id of the corresponding database persisted object.
|
Set<CloudNode> |
getNodes()
Get the set of all nodes associated with this cloud
|
String |
getTargetEntity()
Getter for the target entity string representing the focus topic of this cloud.
|
boolean |
isDirect()
Getter for the
isDirect property of this class. |
void |
removeAllNodes()
Removes all the nodes contained by the current
Cloud . |
Boolean |
removeEdge(CloudEdge edge) |
Boolean |
removeEdge(CloudNode source,
CloudNode target)
Removes the edge between
source node and target node. |
void |
removeEdges()
Removes all the edges contained by the current inCloud.
|
boolean |
removeNode(CloudNode node)
Removes the node passed as argument.
|
boolean |
removeNode(Integer id)
Removes the node represented by
id . |
void |
removeNodes()
Removes all the nodes contained by the current inCloud.
|
protected void |
setEdges(Set<CloudEdge> edges) |
void |
setTargetEntity(String targetEntity)
Setter for the target entity string reprenting the focus topic of this cloud.
|
public static final Integer EDGE_DEFAULT_WEIGHT
protected Cloud()
public Cloud(boolean isDirect)
Only public constructor to generate a new Cloud
object.
isDirect
- defines if the representation of this cloud structure should be a
public CloudNode addNode()
Cloud
.public boolean removeNode(Integer id)
id
.id
- identifier of the node to be removedid
as identifier.public boolean removeNode(CloudNode node)
node
- the node to be removedid
as identifier.public void removeAllNodes()
Cloud
.public CloudEdge addEdge(CloudNode source, CloudNode target, double weight)
Generates a new edge between two nodes owned by this cloud.
If the current cloud is directed, parameters source
and target
represent the direction of the edge (as suggested by parameter names). Otherwise it is
implicitly created a symmetric connection between the two given nodes.
N.B.: Reflexive edges are discarded by default without any error or warning massage.
source
- Source node of the directed edgetarget
- Target node of the directed edgeweight
- Weight of the edgeCloud(boolean)
public CloudEdge addEdge(CloudNode source, CloudNode target)
addEdge(CloudNode, CloudNode, double)
omitting the weight
parameter and using the default EDGE_DEFAULT_WEIGHT
instead.source
- node of the directed edgetarget
- Target node of the directed edgeaddEdge(CloudNode, CloudNode, double)
public CloudEdge getEdge(CloudNode source, CloudNode target)
source
- the source node of the required edge.target
- the target node of the required edge.
Cloud
, also the edge target->source could be returned.public Set<CloudEdge> getEdges(CloudNode source)
source
as source node.source
- the starting node of the required edgessource
as source node (in case of indirect cloud, also the edges having
source
as target node are returned) or the empty set if source
is disconnected.public Boolean removeEdge(CloudNode source, CloudNode target)
source
node and target node.source
- The source node of the edge to be removed.target
- The target node of the edge to be removed.source->target exists and has been removed correctly
source->target has not been found.
public void removeEdges()
public void removeNodes()
public Integer getId()
Get the id of the corresponding database persisted object.
public Set<CloudNode> getNodes()
Get the set of all nodes associated with this cloud
public String getTargetEntity()
Getter for the target entity string representing the focus topic of this cloud.
public void setTargetEntity(String targetEntity)
Setter for the target entity string reprenting the focus topic of this cloud.
targetEntity
- the target entity stringpublic boolean isDirect()
Getter for the isDirect
property of this class.
public Set<CloudEdge> getEdges()
Get the set of all edges associated with this cloud.
N.B.:If the cloud is indirect, an edge A->B
represents also the edge B->A