- java.lang.Object
-
- org.praxislive.code.userapi.Ref.Input<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedInput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Ref.InputclearLinks()Clear all links added withonUpdate()oronUpdate(java.util.function.Consumer).Linkable<List<T>>onUpdate()Returns a newLinkablefor reacting to updates in the list of values.Ref.InputonUpdate(Consumer<List<T>> consumer)Connect a consumer for reacting to updates in the list of values.protected voidupdate(List<Ref<T>> refs)List<T>values()Current list of connected values.
-
-
-
Method Detail
-
values
public List<T> values()
Current list of connected values. This list contains the values from all connected Refs that have initialized and non-null values.- Returns:
- list of connected values
-
clearLinks
public Ref.Input clearLinks()
Clear all links added withonUpdate()oronUpdate(java.util.function.Consumer).- Returns:
- this
-
onUpdate
public Linkable<List<T>> onUpdate()
Returns a newLinkablefor reacting to updates in the list of values. The Linkable will also be called immediately on addition with the existing values.- Returns:
- linkable for values changes
-
onUpdate
public Ref.Input onUpdate(Consumer<List<T>> consumer)
Connect a consumer for reacting to updates in the list of values. The consumer will also be called immediately on addition with the existing values.This method is a shorthand for calling
onUpdate().link(consumer).- Parameters:
consumer- consumer called on updates- Returns:
- this
-
-