Home Reference Source Test Repository
public class | source

Stepper

Helper class for stepping through and playing algorithm results.

Member Summary

Public Members
public
public

result: *

public

speed: *

Method Summary

Public Methods
public

pause()

Pause the stepper if it is currently playing.

public

play(callback: Function)

Play the algorithm results.

public

reset()

Reset the stepper object.

public

Reset the state of the graph by undoing all changes made by the algorithm steps.

public

Set the specified AlgorithmResult object to the "result" field.

public
public
public

Go to the previous algorithm step.

public

Go to the next algorithm step.

Public Members

public interval: * source

public result: * source

public speed: * source

Public Methods

public pause() source

Pause the stepper if it is currently playing.

public play(callback: Function) source

Play the algorithm results. Steps forward until paused or finished.

Params:

NameTypeAttributeDescription
callback Function

Callback function that is called whenever a step is completed.

public reset() source

Reset the stepper object. Clears the algorithm results.

public resetGraph() source

Reset the state of the graph by undoing all changes made by the algorithm steps.

public setResult(result: AlgorithmResult) source

Set the specified AlgorithmResult object to the "result" field.

Params:

NameTypeAttributeDescription
result AlgorithmResult

AlgorithmResult object.

public slowDown(): boolean source

Return:

boolean

public speedUp(): boolean source

Return:

boolean

public stepBackward() source

Go to the previous algorithm step.

public stepForward() source

Go to the next algorithm step.