static class SignalSourceChooser.OfInt<A> extends SignalSourceChooser<A>
SignalSourceChooser.OfEnum<E extends Enum<E>,A>, SignalSourceChooser.OfEnumInt<E extends Enum<E>,A>, SignalSourceChooser.OfInt<A>| Constructor and Description |
|---|
OfInt(IntSignalSource selector,
SignalSource<A>... cases) |
| Modifier and Type | Method and Description |
|---|---|
protected SignalSource<A> |
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.
|
Class<? super A> |
getValueClass()
Returns the type of values produced by this entity.
|
compileDefaultValue, getalwaysThrow, compileDataFlow, compileOrDefaultclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchoose, choose, choose, choose, clock, compileDataFlow, compileMainSignalSource, constant, constant, delayed, delayed, delayedFeedback, delayedFeedback, eq, getConstant, guard, hasConstant, invariant, map, map, neq, power, probe, publishStoredValueVariable, relateWith, sampleAndHold, stored, zipWithcompileDataFlowTo, hasDataFlowIO@SafeVarargs OfInt(IntSignalSource selector, SignalSource<A>... cases)
protected SignalSource<A> choose()
SignalSourceChooserchoose in class SignalSourceChooser<A>protected IntSignalSource getSelector()
AbstractSignalSourceChoosergetSelector in class AbstractSignalSourceChooserCompilableDataFlow.getValueClass()public Class<? super A> getValueClass()
SignalSourceFor signals of primitive value type, the result will be the corresponding pseudoclass.
This implementation returns Object.class. Subclasses
may override this method to provide more specific type
information.
Class.isPrimitive()protected Map<Integer,Consumer<CompilationContext>> getCases(VariableContext.Variable result)
AbstractSignalSourceChooserint-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 AbstractSignalSourceChooserresult - the variable that all branches should output toAbstractSignalSourceChooser.compileConvertToInt()protected Consumer<CompilationContext> compileConvertToInt()
AbstractSignalSourceChooserint.compileConvertToInt in class AbstractSignalSourceChooser