public abstract class Multiplexer extends Observable implements Variable
Constructor and Description |
---|
Multiplexer(Variable selectors,
Variable... depends)
creates a multiplexer that muliplexes the value of from several variables
based an a selector variable.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue()
returns the currently selected variable's value.
|
protected abstract Variable |
getVariable(Variable selector)
return the variable that the selector variable's value indicates
|
void |
setValue(java.lang.Object value)
sets the currently selected variable's value.
|
void |
validate(java.lang.Object value)
validates the
value . |
addObserver, clone, fireChangeEvent, removeObserver
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addObserver, clone, fireChangeEvent, removeObserver
public Multiplexer(Variable selectors, Variable... depends)
selectors
- the selector variabledepends
- list of variables that the value may depend, in addition to
the selector and variablespublic java.lang.Object getValue()
This method returns the value of the currently selected variable, if any, else a null is returned.
public void setValue(java.lang.Object value)
This method sets the value of the currently selected variable, if any.
public void validate(java.lang.Object value)
value
.
Validates the value by calling Variable.validate(Object)
of the
currently selected variable, if any.