- java.lang.Object
-
- org.praxislive.code.userapi.Input
-
public abstract class Input extends Object
A field type providing a control input port. Use with @In or @AuxIn.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedInput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidattach(CodeContext<?> context)InputclearLinks()Clear all Linkables from this Input.protected voidupdateLinks(double value)protected voidupdateLinks(Value value)Linkable.Doublevalues()Return aLinkable.Doublefor reacting on inputs.<T extends Value>
Linkable<T>valuesAs(Class<T> type)Return aLinkableof inputs as the provided Value subclass.<T> Linkable<T>valuesAs(Function<Value,T> converter)Return aLinkableof inputs transformed by the provided converter from Value to the required type.
-
-
-
Method Detail
-
attach
protected void attach(CodeContext<?> context)
-
values
public Linkable.Double values()
Return aLinkable.Doublefor reacting on inputs. None numeric inputs will be ignored.- Returns:
- Linkable.Double of input
-
valuesAs
public <T> Linkable<T> valuesAs(Function<Value,T> converter)
Return aLinkableof inputs transformed by the provided converter from Value to the required type.- Type Parameters:
T-- Parameters:
converter- convert Value to required type- Returns:
- Linkable of input
-
valuesAs
public <T extends Value> Linkable<T> valuesAs(Class<T> type)
Return aLinkableof inputs as the provided Value subclass. If the input Value cannot be coerced to the requested type it will be ignored.- Type Parameters:
T-- Parameters:
type- required Value subclass- Returns:
- Linkable of input
-
clearLinks
public Input clearLinks()
Clear all Linkables from this Input. All previously created Linkables will cease to receive input values.- Returns:
- this
-
updateLinks
protected void updateLinks(double value)
- Parameters:
value-
-
updateLinks
protected void updateLinks(Value value)
- Parameters:
value-
-
-