static class IntSignalSourceChooser.OfInt extends IntSignalSourceChooser
IntSignalSourceChooser.OfEnum<E extends Enum<E>>, IntSignalSourceChooser.OfEnumInt<E extends Enum<E>>, IntSignalSourceChooser.OfInt
Constructor and Description |
---|
OfInt(IntSignalSource selector,
IntSignalSource... cases) |
Modifier and Type | Method and Description |
---|---|
protected IntSignalSource |
choose()
Returns the chosen the input signal source for the current
value.
|
protected Consumer<CompilationContext> |
compileConvertToInt()
Returns a code generator for converting a value that represents the current
selection to an index of type
int . |
protected Map<Integer,Consumer<CompilationContext>> |
getCases(VariableContext.Variable result)
Returns a map with
int -indexed code generators for branches to
choose from. |
protected IntSignalSource |
getSelector()
Returns an entity that can be compiled to code that outputs a
value that represents the current selection.
|
compileDefaultValue, getAsInt
alwaysThrow, compileDataFlow, compileOrDefault
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abs, add, choose, choose, choose, choose, clock, compileDataFlow, compileMainSignalSource, constant, delayed, delayed, delayedFeedback, delayedFeedback, divide, equal, getConstantAsInt, getValueClass, greaterOrEqual, greaterThan, guard, hasConstantAsInt, invariant, lessOrEqual, lessThan, map, max, min, modulo, multiply, negate, negative, nonEqual, nonnegative, nonpositive, nonzero, positive, power, probe, publishStoredValueVariable, relateWith, sampleAndHold, stored, subtract, zero, zipWith
compileDataFlowTo, hasDataFlowIO
@SafeVarargs OfInt(IntSignalSource selector, IntSignalSource... cases)
protected IntSignalSource choose()
IntSignalSourceChooser
choose
in class IntSignalSourceChooser
protected IntSignalSource getSelector()
AbstractSignalSourceChooser
getSelector
in class AbstractSignalSourceChooser
CompilableDataFlow.getValueClass()
protected Map<Integer,Consumer<CompilationContext>> getCases(VariableContext.Variable result)
AbstractSignalSourceChooser
int
-indexed code generators for branches to
choose from. The returned map should contain an entry for every valid
index. The method AbstractSignalSourceChooser.compileOrDefault(eu.bandm.tools.lljava.live.VariableContext.Variable, eu.bandm.sig.adlib2.compile.CompilableDataFlow)
may be used to populate the map.getCases
in class AbstractSignalSourceChooser
result
- the variable that all branches should output toAbstractSignalSourceChooser.compileConvertToInt()
protected Consumer<CompilationContext> compileConvertToInt()
AbstractSignalSourceChooser
int
.compileConvertToInt
in class AbstractSignalSourceChooser