public abstract class IntSignalSourceChooser extends AbstractSignalSourceChooser implements IntSignalSource
int
that choose
dynamically from a fixed collection of inputs.Modifier and Type | Class and Description |
---|---|
(package private) static class |
IntSignalSourceChooser.OfEnum<E extends Enum<E>> |
(package private) static class |
IntSignalSourceChooser.OfEnumInt<E extends Enum<E>> |
(package private) static class |
IntSignalSourceChooser.OfInt |
Constructor and Description |
---|
IntSignalSourceChooser() |
Modifier and Type | Method and Description |
---|---|
protected abstract IntSignalSource |
choose()
Returns the chosen the input signal source for the current
value.
|
protected Consumer<CompilationContext> |
compileDefaultValue()
Returns a code generator for loading the default value of the signal type
on the operand stack.
|
int |
getAsInt()
Returns the current value of this signal source.
|
alwaysThrow, compileConvertToInt, compileDataFlow, compileOrDefault, getCases, getSelector
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
protected abstract IntSignalSource choose()
public int getAsInt()
The value may be either computed on demand, or retrieved from storage.
Implementations of this method should have no side effect.
getAsInt
in interface IntSignalSource
getAsInt
in interface IntSupplier
protected Consumer<CompilationContext> compileDefaultValue()
AbstractSignalSourceChooser
compileDefaultValue
in class AbstractSignalSourceChooser