com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort Class Reference

Collaboration diagram for com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort:
Collaboration graph
[legend]

List of all members.

Classes

class  ComponentInfoVertex

Public Member Functions

 ComponentInfoTopologicalSort (int capacity) throws IllegalArgumentException
 ComponentInfoTopologicalSort (HandleDataStore dataStore)
void insert (ComponentInfoVertex element)
ComponentInfoVertex extract ()
ComponentInfoVertex peek ()
int size ()
void clear ()

Static Public Member Functions

static List sort (HandleDataStore handleDataStore)

Protected Member Functions

final int parent (int k)
final int left (int k)
final int right (int k)
void downheap (ComponentInfoVertex element, int k)
ComponentInfoVertex heapExtract ()

Protected Attributes

ComponentInfoVertex[] nodes
int count = 0
IntHashMap handleToHashIndexMap
HandleDataStore handleDataStore

Private Member Functions

HashSet generateImmortalChainMap (HandleDataStore dataStore)
void markImmortalChain (HashSet immortalChainMap, HandleDataStore dataStore, int marker)

Detailed Description

An implementation of topological sort operating on ComponentInfo handle data store.


Constructor & Destructor Documentation

com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoTopologicalSort ( int  capacity  )  throws IllegalArgumentException [inline]

Create a Heap with the given initial capacity and comparator.

Parameters:
capacity initial heap capacity.
cmp comparator used to compare objects, if null natural ordering is used
Exceptions:
IllegalArgumentException if capacity less than zero

References handleToHashIndexMap, and nodes.

Referenced by sort().

com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoTopologicalSort ( HandleDataStore  dataStore  )  [inline]

Member Function Documentation

void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::clear (  )  [inline]

Remove all elements.

References count, and nodes.

void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::downheap ( ComponentInfoVertex  element,
int  k 
) [inline, protected]
ComponentInfoVertex com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::extract (  )  [inline]
HashSet com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::generateImmortalChainMap ( HandleDataStore  dataStore  )  [inline, private]

Generate immortal chain.

Parameters:
dataStore ComponentInfo handle data store instance to sort.
Returns:
set of components (immportal or components which clients are immortal components).

References markImmortalChain().

Referenced by ComponentInfoTopologicalSort().

ComponentInfoVertex com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::heapExtract (  )  [inline, protected]
void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::insert ( ComponentInfoVertex  element  )  [inline]

Insert an element, resize if necessary.

Parameters:
element object to be insterted.

References count, downheap(), and nodes.

Referenced by ComponentInfoTopologicalSort().

final int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::left ( int  k  )  [inline, protected]

Return left child node.

Parameters:
k index of a parent node.

Referenced by heapExtract().

void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::markImmortalChain ( HashSet  immortalChainMap,
HandleDataStore  dataStore,
int  marker 
) [inline, private]

DSF algrithm to generate immortal chain.

Parameters:
immortalChainMap set of components (immportal or components which clients are immortal components).
dataStore ComponentInfo handle data store instance to sort.
marker handle of the object which identifies member of immortal chain.

References com::cosylab::acs::maci::manager::HandleDataStore::first, com::cosylab::acs::maci::manager::HandleDataStore::get(), com::cosylab::acs::maci::ComponentInfo::getClients(), com::cosylab::acs::maci::ComponentInfo::getHandle(), com::cosylab::acs::maci::manager::HandleDataStore::next(), and com::cosylab::acs::maci::IntArray::toArray().

Referenced by generateImmortalChainMap().

final int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::parent ( int  k  )  [inline, protected]

Return parent node of the child.

Parameters:
k index of a child node.

Referenced by downheap().

ComponentInfoVertex com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::peek (  )  [inline]

Return least element without removing it, or null if empty

Returns:
least element (min).

References count, and nodes.

final int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::right ( int  k  )  [inline, protected]

Return right child node.

Parameters:
k index of a parent node.

Referenced by heapExtract().

int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::size (  )  [inline]

Return number of elements.

Returns:
number of elements

References count.

Referenced by sort().

static List com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::sort ( HandleDataStore  handleDataStore  )  [inline, static]

Topological sort on ComponentInfo handle data store.

Parameters:
handleDataStore ComponentInfo handle data store
Returns:
topologically sorted list.

References ComponentInfoTopologicalSort(), extract(), com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::getComponentInfo(), and size().


Member Data Documentation

Number of used slots.

Referenced by clear(), heapExtract(), insert(), peek(), and size().

Handle data store.

Referenced by ComponentInfoTopologicalSort().

Handle to hash index lookups.

Referenced by ComponentInfoTopologicalSort(), downheap(), extract(), and heapExtract().

The tree nodes, packed into an array.

Referenced by clear(), ComponentInfoTopologicalSort(), downheap(), extract(), heapExtract(), insert(), and peek().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2