public abstract class IntClockedSignalSource extends Object implements IntSignalSource, SignalSource<Integer>, Realtime
SignalSource.AddOperator, SignalSource.CompilableBinaryOperator, SignalSource.Constant<A>, SignalSource.DivOperator, SignalSource.MultOperator, SignalSource.SubOperator
Modifier and Type | Field and Description |
---|---|
protected int |
out
The current value.
|
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS
Modifier | Constructor and Description |
---|---|
protected |
IntClockedSignalSource()
Creates a new instance with no specified initial value.
|
protected |
IntClockedSignalSource(int init)
Creates a new instance with the given initial value.
|
Modifier and Type | Method and Description |
---|---|
<V,L> void |
compileDataFlow(CompilationContext<V,L> context) |
static IntClockedSignalSource |
counter() |
static IntClockedSignalSource |
counter(int modulus) |
static IntClockedSignalSource |
counter(int modulus,
int initial) |
Integer |
get()
Deprecated.
|
int |
getAsInt() |
Realtime |
logged(String name)
Creates a wrapper that emits the same signal values as this
object, but produces a logging output as side effect on each
clock event.
|
Realtime |
logged(String name,
PrintStream out)
Creates a wrapper that emits the same signal values as this
object, but produces a logging output as side effect on each
clock event.
|
static IntClockedSignalSource |
suppliedBy(int init,
IntSupplier step) |
static IntClockedSignalSource |
suppliedBy(IntSupplier supplier) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
constant, logger, logger, zipWith
constant
adHoc, afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, run, sequence, times, times
protected IntClockedSignalSource()
protected IntClockedSignalSource(int init)
init
- the initial value.public final int getAsInt()
getAsInt
in interface IntSignalSource
getAsInt
in interface IntSupplier
out
.@Deprecated public final Integer get()
public static IntClockedSignalSource suppliedBy(IntSupplier supplier)
public static IntClockedSignalSource suppliedBy(int init, IntSupplier step)
public Realtime logged(String name)
name
- the name to associate with the current signal value
in logging output, or null
for anonymous output.IntSignalSource.logger(String)
public Realtime logged(String name, PrintStream out)
name
- the name to associate with the current signal value
in logging output, or null
for anonymous output.out
- the output stream to use for logging.IllegalArgumentException
- if out == null
.IntSignalSource.logger(String, PrintStream)
public static IntClockedSignalSource counter()
public static IntClockedSignalSource counter(int modulus)
public static IntClockedSignalSource counter(int modulus, int initial)
public final <V,L> void compileDataFlow(CompilationContext<V,L> context)
compileDataFlow
in interface CompilableDataFlow
compileDataFlow
in interface IntSignalSource