Interface PrioritySetElement<P>

Interface for prioritized elements than be hooked into a linked list.

interface PrioritySetElement<P> {
    getPriority: (() => P);
    hasPriorityOver: ((node: PrioritySetElement<P>) => boolean);
    next: undefined | PrioritySetElement<P>;
    updateIfDuplicateOf: ((node: undefined | PrioritySetElement<P>) => boolean);
}

Type Parameters

  • P

Implemented by

Properties

getPriority: (() => P)

Return the priority of this node.

hasPriorityOver: ((node: PrioritySetElement<P>) => boolean)

Return true if this node has priority over the given node, false otherwise.

Type declaration

    • (node): boolean
    • Parameters

      Returns boolean

next: undefined | PrioritySetElement<P>

Pointer to the next node in the priority set.

updateIfDuplicateOf: ((node: undefined | PrioritySetElement<P>) => boolean)

If the given node is considered a duplicate of this node, then update this node if needed, and return true. Return false otherwise.

Type declaration

    • (node): boolean
    • Parameters

      • node: undefined | PrioritySetElement<P>

        A node that may or may not be a duplicate of this node.

      Returns boolean