
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) |
An implementation of topological sort operating on ComponentInfo handle data store.
| com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoTopologicalSort | ( | int | capacity | ) | throws IllegalArgumentException [inline] |
Create a Heap with the given initial capacity and comparator.
| capacity | initial heap capacity. | |
| cmp | comparator used to compare objects, if null natural ordering is used |
| IllegalArgumentException | if capacity less than zero |
References handleToHashIndexMap, and nodes.
Referenced by sort().
| com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoTopologicalSort | ( | HandleDataStore | dataStore | ) | [inline] |
Constructor.
| dataStore | ComponentInfo handle data store instance to sort. |
References com::cosylab::acs::maci::manager::HandleDataStore::first, generateImmortalChainMap(), com::cosylab::acs::maci::manager::HandleDataStore::get(), handleDataStore, insert(), com::cosylab::acs::maci::manager::HandleDataStore::next(), and com::cosylab::acs::maci::manager::HandleDataStore::size.
| void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::clear | ( | ) | [inline] |
| void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::downheap | ( | ComponentInfoVertex | element, | |
| int | k | |||
| ) | [inline, protected] |
| element | ||
| k |
References com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::compareTo(), com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::getComponentInfo(), com::cosylab::acs::maci::ComponentInfo::getHandle(), handleToHashIndexMap, nodes, parent(), and com::cosylab::acs::maci::manager::IntHashMap::put().
| ComponentInfoVertex com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::extract | ( | ) | [inline] |
Return and remove least element, or null if empty.
References com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::decrementIndegree(), downheap(), com::cosylab::acs::maci::manager::IntHashMap::get(), com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::getComponentInfo(), com::cosylab::acs::maci::ComponentInfo::getComponents(), com::cosylab::acs::maci::ComponentInfo::getHandle(), handleToHashIndexMap, heapExtract(), com::cosylab::acs::maci::IntArray::isEmpty(), nodes, and com::cosylab::acs::maci::IntArray::toArray().
Referenced by sort().
| HashSet com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::generateImmortalChainMap | ( | HandleDataStore | dataStore | ) | [inline, private] |
Generate immortal chain.
| dataStore | ComponentInfo handle data store instance to sort. |
References markImmortalChain().
Referenced by ComponentInfoTopologicalSort().
| ComponentInfoVertex com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::heapExtract | ( | ) | [inline, protected] |
Return and remove least element, or null if empty.
References com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::compareTo(), count, com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::getComponentInfo(), com::cosylab::acs::maci::ComponentInfo::getHandle(), handleToHashIndexMap, left(), nodes, com::cosylab::acs::maci::manager::IntHashMap::put(), com::cosylab::acs::maci::manager::IntHashMap::remove(), and right().
Referenced by extract().
| void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::insert | ( | ComponentInfoVertex | element | ) | [inline] |
Insert an element, resize if necessary.
| 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] |
| void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::markImmortalChain | ( | HashSet | immortalChainMap, | |
| HandleDataStore | dataStore, | |||
| int | marker | |||
| ) | [inline, private] |
DSF algrithm to generate immortal chain.
| 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] |
| ComponentInfoVertex com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::peek | ( | ) | [inline] |
| final int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::right | ( | int | k | ) | [inline, protected] |
| int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::size | ( | ) | [inline] |
| static List com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::sort | ( | HandleDataStore | handleDataStore | ) | [inline, static] |
Topological sort on ComponentInfo handle data store.
| handleDataStore | ComponentInfo handle data store |
References ComponentInfoTopologicalSort(), extract(), com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::ComponentInfoVertex::getComponentInfo(), and size().
int com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::count = 0 [protected] |
Number of used slots.
Referenced by clear(), heapExtract(), insert(), peek(), and size().
HandleDataStore com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::handleDataStore [protected] |
Handle data store.
Referenced by ComponentInfoTopologicalSort().
IntHashMap com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::handleToHashIndexMap [protected] |
Handle to hash index lookups.
Referenced by ComponentInfoTopologicalSort(), downheap(), extract(), and heapExtract().
ComponentInfoVertex [] com::cosylab::acs::maci::manager::ComponentInfoTopologicalSort::nodes [protected] |
The tree nodes, packed into an array.
Referenced by clear(), ComponentInfoTopologicalSort(), downheap(), extract(), heapExtract(), insert(), and peek().
1.6.2