Skip to content

Add simplest possible left and right "stairs" converters for sequences. #30

@konard

Description

@konard

image

image

Do not use ∅, pictures are wrong.

The correct source example is:

[1, 2, 3, 4]

Two ways to transform this into sequences

DescendingVariantConverter

This converter starts with a pair of two first elements and the goes "down the hill".

(((1 2) 3) 4)

Where (1 2) means, that it's ID used to make next pair and so on.

var doubletId = _links.GetOrCreate(sequence[0], sequence[1])

AscendingVariantConverter

In that case, converter starts from the end of list/sequence/array.

The complete result will be:

(1 (2 (3 4)))

Where (3 4) means, that it's ID used to make next pair and so on.

var doubletId = _links.GetOrCreate(sequence[i-1], sequence[i])

P.S.

Both sequences should be created at ./csharp/Platform.Data.Doublets.Sequences/Converters folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions