All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.ggdsl.dsl.sourceScaled.kt Maven / Gradle / Ivy

There is a newer version: 0.4.0-dev-15
Show newest version
package org.jetbrains.kotlinx.ggdsl.dsl

import org.jetbrains.kotlinx.ggdsl.ir.bindings.*
import org.jetbrains.kotlinx.ggdsl.ir.data.DataSource
import org.jetbrains.kotlinx.ggdsl.ir.scale.NonPositionalScale
import org.jetbrains.kotlinx.ggdsl.ir.scale.NonPositionalUnspecifiedScale
import org.jetbrains.kotlinx.ggdsl.ir.scale.PositionalScale
import org.jetbrains.kotlinx.ggdsl.ir.scale.PositionalUnspecifiedScale
import kotlin.reflect.KProperty

/**
 *  Apply default scale to this [DataSource]
 */
fun  DataSource.scaled() =
    SourceScaledUnspecifiedDefault(this)

inline fun  KProperty.scaled() =
    SourceScaledUnspecifiedDefault(this.toDataSource())

/**
 * Apply unspecified positional scale to this [DataSource]
 *
 * @param DomainType type of domain
 * @param scale positional default scale
 * @return scaled source
 */
fun  DataSource.scaled(scale: PositionalUnspecifiedScale) =
    SourceScaledPositionalUnspecified(this, scale)

inline fun  KProperty.scaled(scale: PositionalUnspecifiedScale) =
    SourceScaledPositionalUnspecified(this.toDataSource(), scale)

/**
 * Apply unspecified non-positional scale to this [DataSource]
 *
 * @param DomainType type of domain
 * @param scale non-positional default scale
 * @return scaled source
 */
fun  DataSource.scaled(scale: NonPositionalUnspecifiedScale) =
    SourceScaledNonPositionalUnspecified(this, scale)

inline fun  KProperty.scaled(scale: NonPositionalUnspecifiedScale) =
    SourceScaledNonPositionalUnspecified(this.toDataSource(), scale)

/**
 * Apply positional scale to this [DataSource]
 *
 * @param DomainType type of domain
 * @param scale positional scale
 * @return scaled source
 */
fun  DataSource.scaled(
    scale: PositionalScale
) = SourceScaledPositional(this, scale)

inline fun  KProperty.scaled(
    scale: PositionalScale
) = SourceScaledPositional(this.toDataSource(), scale)

/**
 * Apply non-positional scale to this [DataSource]
 *
 * @param DomainType type of domain
 * @param scale non-positional scale
 * @return scaled source
 */
fun  DataSource.scaled(
    scale: NonPositionalScale
) = SourceScaledNonPositional(this, scale)

inline fun  KProperty.scaled(
    scale: NonPositionalScale
) = SourceScaledNonPositional(this.toDataSource(), scale)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy