Distribute

Allocates the Money difference by distributing every unit of it according to allocator.

Parameters

allocator

The DifferenceAllocation instance to allocate the difference units.

Constructors

Link copied to clipboard
constructor(allocator: DifferenceAllocation)

Types

Link copied to clipboard
object Factory

A Distribute factory.

Properties

Link copied to clipboard
open override val allocator: DifferenceAllocation

Functions

Link copied to clipboard
open override fun allocate(difference: Money, allocations: List<Money>): List<Money>

Allocates the difference in the allocations list.

Link copied to clipboard
open tailrec override fun distribute(units: List<Money>, allocations: List<Money>): List<Money>

Distributes the difference units in the allocations list.