LimitedDoubleProperty

open class LimitedDoubleProperty(    lowerBoundInclusive: Number = Double.NEGATIVE_INFINITY,     upperBoundInclusive: Number = Double.POSITIVE_INFINITY,     initialValue: Number = lowerBoundInclusive) : Property<Double>

A limited DoubleProperty to a value range. Value will be checked to be in range lowerBoundInclusive to upperBoundInclusive.

Therefore upperBoundInclusive must be greater or equal to lowerBoundInclusive. The Range is constant and cannot be altered after object creation.

Parameters

lowerBoundInclusive

Lower bound inclusive. Default: -inf.

upperBoundInclusive

Upper bound inclusive. Default: +inf.

initialValue

Initial Value. Default: lowerBoundInclusive.

Throws

If a value out of range is set as initialValue.

Constructors

Link copied to clipboard
fun LimitedDoubleProperty(    lowerBoundInclusive: Number = Double.NEGATIVE_INFINITY,     upperBoundInclusive: Number = Double.POSITIVE_INFINITY,     initialValue: Number = lowerBoundInclusive)

Creates a LimitedDoubleProperty with given bounds and initial value.

Functions

Link copied to clipboard
fun addListener(listener: ValueObserver<Double>)

Adds a listener silently.

Link copied to clipboard
fun addListenerAndInvoke(initialValue: Double, listener: (Double, Double) -> Unit)

Adds a listener and calls ValueObserver.update on this new listener with given initial value.

Link copied to clipboard
fun clearListeners()

Removes all listeners.

Link copied to clipboard
fun notifyUnchanged()

Notifies all listeners with current value.

Link copied to clipboard
fun removeListener(listener: ValueObserver<Double>): Boolean

Removes a listener.

Properties

Link copied to clipboard
open override var value: Double

Value of this property.