8.37. File tom/HeapElement

class tom.HeapElement

inherits

State supers: State, Comparable

instance tom.HeapElement

variables

int heap_index;

The index of the element within the Heap it is stored. This index is 1 more than the index in the elements Array of the Heap. If this element is not part of a heap, this index is 0.

methods


void
  set_index int index
    in_heap Heap heap;

Set the heap_index to index, without checking the heap.


int
  index_in_heap Heap heap;

Return the heap_index, assuming a correct heap.