Packageorg.rapidphysics.system
Classpublic class RapidHeap
InheritanceRapidHeap Inheritance Object

A Binary Heap min heap with vector implementation



Public Properties
 PropertyDefined By
  length : int
[read-only]
RapidHeap
Public Methods
 MethodDefined By
  
RapidHeap(pCompare:Function)
RapidHeap
  
clear():void
RapidHeap
  
insert(obj:Collision):void
Add the element on the bottom level of the heap.
RapidHeap
  
isEmpty():Boolean
RapidHeap
  
remove the root put the bottom element in its place heapify
RapidHeap
Property Detail
lengthproperty
length:int  [read-only]


Implementation
    public function get length():int
Constructor Detail
RapidHeap()Constructor
public function RapidHeap(pCompare:Function)



Parameters
pCompare:Function
Method Detail
clear()method
public function clear():void

insert()method 
public function insert(obj:Collision):void

Add the element on the bottom level of the heap. Compare the added element with its parent; if they are in the correct order, stop. If not, swap the element with its parent and return to the previous step.

Parameters

obj:Collision

isEmpty()method 
public function isEmpty():Boolean

Returns
Boolean
removeMin()method 
public function removeMin():Collision

remove the root put the bottom element in its place heapify

Returns
Collision