Class LongDelay

All Implemented Interfaces:
AbstractClockedSignalSource, AbstractSignalSource, Component, LongClockedSignalSource, LongSignalSource, Process, Register, LongSupplier

public class LongDelay extends LongStoredSignalSource implements Register
A component that forwards the value from an input signal source delayed by a single clock tick.
  • Constructor Details

    • LongDelay

      public LongDelay(long initial)
      Creates a new instance without a valid input source.

      The method setInput(LongSignalSource) must be invoked before this signal source can be used.

      Parameters:
      initial - the initial value of this signal source
    • LongDelay

      public LongDelay(long initial, LongSignalSource in)
      Creates a new instance with an independent input source.
      Parameters:
      initial - the initial value of this signal source
      in - the input signal source
    • LongDelay

      public LongDelay(long initial, Function<? super LongDelay,? extends LongSignalSource> in)
      Creates a new instance with a feedback-looped input source.

      A reference to the new delay signal source d under construction is passed to the function object in in order to create the feedback loop. This reference may only be used by passing to other signal source constructions. Behavior is unspecified if any behavioral method is invoked on d before in.apply(d) has returned.

      Parameters:
      initial - the initial value of this signal source
      in - a function that constructs the input signal source when applied to this delayed signal source
  • Method Details

    • setInput

      public void setInput(LongSignalSource in)
    • getLoadPhase

      public Process getLoadPhase()
      Returns the load phase of this register.
      Specified by:
      getLoadPhase in interface Register
      Returns:
      the load phase of this register
    • getStorePhase

      public Process getStorePhase()
      Returns the store phase of this register.
      Specified by:
      getStorePhase in interface Register
      Returns:
      the store phase of this register
    • init

      public void init()
      Initializes the state of this process. The state is initialized such that the first subsequent call to Process.step() transitions to the first specified observable state.

      The default implementation does nothing.

      Specified by:
      init in interface Process
      Specified by:
      init in interface Register
    • step

      public void step()
      Signals a time event, executing a transition step for this process to the next observable state.

      The state of the process after successful completion of this method should be the n-th observable state, if Process.step() has been invoked n times since the last initialization via Process.init(). The behavior of this method is unspecified if Process.init() has not been invoked before.

      FIXME: Process.setRealtimeContext(eu.bandm.sig.adlib2.RealtimeContext)

      If this method completes abruptly by throwing an error or unchecked exception, the process state should be considered invalid.

      Specified by:
      step in interface Process
      Specified by:
      step in interface Register
    • getNextValue

      public long getNextValue()
      Returns the value that will be produced on the next clock tick.

      This method is in concurrent reader–writer conflict with the getStorePhase() process.

    • setNextValue

      public void setNextValue(long next)
      Sets the value that will be produced on the next clock tick.

      This method is in concurrent writer–writer conflict with the getStorePhase() process.