Sorting: Create a streamer for sorting incoming data

Description Format Methods Examples

Description

Sorting creates a streaming algorithm that can be used to sort incoming data

Format

An R6Class generator object

Methods

Public methods


Method new()

Creates a new Sorting streamer object.

Usage
Sorting$new(x = NULL, method = "linked-list")
Arguments
x

values to be used during initialisation (optional)

method

the method used to sort values

Returns

The new Sorting (invisibly)


Method update()

Updates the Sorting streamer object.

Usage
Sorting$update(x)
Arguments
x

values to be added to the stream

Returns

The updated Sorting (invisibly)


Method clone()

The objects of this class are cloneable with this method.

Usage
Sorting$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
sorter <- Sorting$new(c(3, 1))
sorter$update(c(2, 4))
sorter$value
#> [1] 1 2 3 4

THargreaves/onlineoceanarium documentation built on Jan. 13, 2022, 10:41 p.m.