public abstract class LongSignalSourceChooser extends AbstractSignalSourceChooser implements LongSignalSource
long
that choose
dynamically from a fixed collection of inputs.Modifier and Type | Class and Description |
---|---|
(package private) static class |
LongSignalSourceChooser.OfEnum<E extends Enum<E>> |
(package private) static class |
LongSignalSourceChooser.OfEnumInt<E extends Enum<E>> |
(package private) static class |
LongSignalSourceChooser.OfInt |
Constructor and Description |
---|
LongSignalSourceChooser() |
Modifier and Type | Method and Description |
---|---|
protected abstract LongSignalSource |
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.
|
long |
getAsLong()
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, getConstantAsLong, getValueClass, greaterOrEqual, greaterThan, guard, hasConstantAsLong, 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 LongSignalSource choose()
public long getAsLong()
The value may be either computed on demand, or retrieved from storage.
Implementations of this method should have no side effect.
getAsLong
in interface LongSignalSource
getAsLong
in interface LongSupplier
protected Consumer<CompilationContext> compileDefaultValue()
AbstractSignalSourceChooser
compileDefaultValue
in class AbstractSignalSourceChooser