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

pl.allegro.mobile.logic.operators.arithmetic.DivisionOperation.kt Maven / Gradle / Ivy

package pl.allegro.mobile.logic.operators.arithmetic

import pl.allegro.mobile.logic.ClientLogicElement
import pl.allegro.mobile.logic.ClientLogicMarker
import pl.allegro.mobile.logic.NumberElement
import pl.allegro.mobile.logic.operators.OperatorFactory

internal interface DivisionOperation {
    @ClientLogicMarker
    fun ClientLogicElement.divide(denominator: ClientLogicElement) = DivideOperatorFactory().create(this, denominator)

    @ClientLogicMarker
    fun ClientLogicElement.divide(denominator: Number) = divide(NumberElement(denominator))

    @ClientLogicMarker
    fun Number.divide(denominator: ClientLogicElement) = NumberElement(this).divide(denominator)
}

private class DivideOperatorFactory : OperatorFactory(name = "/")




© 2015 - 2024 Weber Informatics LLC | Privacy Policy