DexNet  4.8.2
Public Member Functions | List of all members
com.sparsity.dex.algorithms.ConnectedComponents Class Reference

ConnectedComponents class. More...

Public Member Functions

boolean IsClosed ()
 Gets if ConnectedComponents instance has been closed or not. More...
 
void Close ()
 Closes the ConnectedComponents instance. More...
 
long GetCount ()
 Returns the number of connected components found in the graph. More...
 
 ConnectedComponents (com.sparsity.dex.gdb.Session s, System.String materializedattribute)
 Creates a new instance of ConnectedComponents. More...
 
long GetConnectedComponent (long idNode)
 Returns the connected component where the given node belongs to. More...
 
long GetSize (long idConnectedComponent)
 Returns the number of nodes contained in the given connected component. More...
 
com.sparsity.dex.gdb.Objects GetNodes (long idConnectedComponent)
 Returns the collection of nodes contained in the given connected component. More...
 

Detailed Description

ConnectedComponents class.

This class contains the results processed on a Connectivity algorithm.

These results contain information related to the connected components found. We must consider that each connected component has a number in order to identify it. These number identifiers are values from 0 to N-1, where N is the number of different connected components found.

When executing any implementation of the Connectivity, it is possible to indicate whether the results of the execution must be stored persistently using the Connectivity::setMaterializedAttribute method. In case the results are set to be materialized, users can retrieve this data whenever they want, even if the graph has been closed and opened again, just by creating a new instance of this class.

Check out the 'Algorithms' section in the DEX User Manual for more details on this.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Constructor & Destructor Documentation

com.sparsity.dex.algorithms.ConnectedComponents.ConnectedComponents ( com.sparsity.dex.gdb.Session  s,
System.String  materializedattribute 
)

Creates a new instance of ConnectedComponents.

This constructor method can only be called when a previous execution of any implementation of the Connectivity class has materialized the results in a common attribute type for all the nodes in the graph. For further information about materializing the results processed on any Connectivity execution see the documentation of the Connectivity::SetMaterializedAttribute method.

Parameters
s[in] Session to get the graph Graph on which the information will be retrieved just by getting the values contained in the given common attribute type for all the nodes in the graph and processing them.
materializedattribute[in] The common attribute type for all the nodes in the graph where data will be retrieved in order to process the results related to the connected components found in the graph.

Member Function Documentation

void com.sparsity.dex.algorithms.ConnectedComponents.Close ( )

Closes the ConnectedComponents instance.

It must be called to ensure the integrity of all data.

long com.sparsity.dex.algorithms.ConnectedComponents.GetConnectedComponent ( long  idNode)

Returns the connected component where the given node belongs to.

Parameters
idNode[in] The node identifier for which the connected component identifier where it belongs will be returned.
Returns
The connected component identifier where the given node identifier belongs to.
long com.sparsity.dex.algorithms.ConnectedComponents.GetCount ( )

Returns the number of connected components found in the graph.

Returns
The number of connected components found in the graph.
com.sparsity.dex.gdb.Objects com.sparsity.dex.algorithms.ConnectedComponents.GetNodes ( long  idConnectedComponent)

Returns the collection of nodes contained in the given connected component.

Parameters
idConnectedComponentThe connected component for which the collection of nodes contained in it will be returned.
Returns
The collection of node identifiers contained in the given connected component.
long com.sparsity.dex.algorithms.ConnectedComponents.GetSize ( long  idConnectedComponent)

Returns the number of nodes contained in the given connected component.

Parameters
idConnectedComponentThe connected component for which the number of nodes contained in it will be returned.
Returns
The number of nodes contained in the given connected component.
boolean com.sparsity.dex.algorithms.ConnectedComponents.IsClosed ( )

Gets if ConnectedComponents instance has been closed or not.

See Also
Close()
Returns
TRUE if the ConnectedComponents instance has been closed, FALSE otherwise.