E
- the enum
type of the values of this signal sourcepublic interface EnumSignalSource<E extends Enum<E>> extends IntSignalSource
enum
values at
construction time but ordinal int
values at runtime.Enum.ordinal()
Modifier and Type | Method and Description |
---|---|
default SignalSource<E> |
box() |
static <E extends Enum<E>> |
choose(BooleanSignalSource condition,
EnumSignalSource<E> inTrue,
EnumSignalSource<E> inFalse) |
default <A> SignalSource<A> |
choose(EnumMap<E,? extends SignalSource<A>> cases) |
static <E extends Enum<E>,F extends Enum<F>> |
choose(EnumSignalSource<E> condition,
EnumMap<E,? extends EnumSignalSource<F>> cases) |
default BooleanSignalSource |
chooseBoolean(EnumMap<E,? extends BooleanSignalSource> cases) |
default DoubleSignalSource |
chooseDouble(EnumMap<E,? extends DoubleSignalSource> cases) |
default <F extends Enum<F>> |
chooseEnum(EnumMap<E,? extends EnumSignalSource<F>> cases) |
default FloatSignalSource |
chooseFloat(EnumMap<E,? extends FloatSignalSource> cases) |
default IntSignalSource |
chooseInt(EnumMap<E,? extends IntSignalSource> cases) |
default LongSignalSource |
chooseLong(EnumMap<E,? extends LongSignalSource> cases) |
static <E extends Enum<E>> |
constant(E value)
Returns a signal source whose value is constant (never changes).
|
Class<E> |
getEnumClass() |
static <E extends Enum<E>> |
of(Class<E> enumClass,
SignalSource<E> body) |
default EnumClockedSignalSource<E> |
stored()
Returns a new signal source that stores snapshot values of this signal
source driven by a clock.
|
abs, add, choose, choose, choose, choose, clock, compileDataFlow, compileMainSignalSource, delayed, delayed, delayedFeedback, delayedFeedback, divide, equal, getAsInt, 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, subtract, zero, zipWith
compileDataFlowTo, hasDataFlowIO
static <E extends Enum<E>> EnumSignalSource<E> constant(E value)
IntSignalSource
constant
in interface IntSignalSource
value
- the value of the new signal sourcestatic <E extends Enum<E>> EnumSignalSource<E> of(Class<E> enumClass, SignalSource<E> body)
default SignalSource<E> box()
default EnumClockedSignalSource<E> stored()
IntSignalSource
The IntSignalSource.getAsInt()
method of the returned signal
source is guaranteed to be extremely fast, both in interpreted
and compiled mode. The computational effort of the underlying
signal source is instead spent on the Process.step(RealtimeContext)
method of the
returned signal source, to be invoked at each clock tick.
If the underlying signal source is constant, the value is
forwarded when the Process.init()
method of the returned signal source is invoked, where as its
implementation of Process.step(RealtimeContext)
does nothing.
stored
in interface IntSignalSource
default <A> SignalSource<A> choose(EnumMap<E,? extends SignalSource<A>> cases)
default <F extends Enum<F>> EnumSignalSource<F> chooseEnum(EnumMap<E,? extends EnumSignalSource<F>> cases)
default FloatSignalSource chooseFloat(EnumMap<E,? extends FloatSignalSource> cases)
default DoubleSignalSource chooseDouble(EnumMap<E,? extends DoubleSignalSource> cases)
default IntSignalSource chooseInt(EnumMap<E,? extends IntSignalSource> cases)
default LongSignalSource chooseLong(EnumMap<E,? extends LongSignalSource> cases)
default BooleanSignalSource chooseBoolean(EnumMap<E,? extends BooleanSignalSource> cases)
static <E extends Enum<E>,F extends Enum<F>> EnumSignalSource<F> choose(EnumSignalSource<E> condition, EnumMap<E,? extends EnumSignalSource<F>> cases)
static <E extends Enum<E>> EnumSignalSource<E> choose(BooleanSignalSource condition, EnumSignalSource<E> inTrue, EnumSignalSource<E> inFalse)