Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

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

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

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

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
com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.ComponentInfoTopologicalSort ( HandleDataStore  dataStore  ) 

Constructor.

Parameters:
dataStore ComponentInfo handle data store instance to sort.

References com.cosylab.acs.maci.manager.HandleDataStore.get(), and com.cosylab.acs.maci.manager.HandleDataStore.next().


Member Function Documentation

void com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.clear (  ) 

Remove all elements.

void com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.downheap ( ComponentInfoVertex  element,
int  k 
) [protected]
Parameters:
element 
k 

References com.cosylab.acs.maci.manager.IntHashMap.put().

ComponentInfoVertex com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.extract (  ) 

Return and remove least element, or null if empty.

Returns:
least element (min).

References com.cosylab.acs.maci.manager.IntHashMap.get().

Referenced by com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.sort().

ComponentInfoVertex com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.heapExtract (  )  [protected]

Return and remove least element, or null if empty.

Returns:
least element (min).

References com.cosylab.acs.maci.manager.IntHashMap.put(), and com.cosylab.acs.maci.manager.IntHashMap.remove().

void com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.insert ( ComponentInfoVertex  element  ) 

Insert an element, resize if necessary.

Parameters:
element object to be insterted.
final int com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.left ( int  k  )  [protected]

Return left child node.

Parameters:
k index of a parent node.
final int com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.parent ( int  k  )  [protected]

Return parent node of the child.

Parameters:
k index of a child node.
ComponentInfoVertex com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.peek (  ) 

Return least element without removing it, or null if empty

Returns:
least element (min).
final int com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.right ( int  k  )  [protected]

Return right child node.

Parameters:
k index of a parent node.
int com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.size (  ) 

Return number of elements.

Returns:
number of elements

Referenced by com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.sort().

static List com.cosylab.acs.maci.manager.ComponentInfoTopologicalSort.sort ( HandleDataStore  handleDataStore  )  [static]

Topological sort on ComponentInfo handle data store.

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

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


Member Data Documentation

Number of used slots.

Handle data store.

Handle to hash index lookups.

The tree nodes, packed into an array.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties