Interface SignalComputation<T extends @Nullable Object>

Type Parameters:
T - the computed value type
All Superinterfaces:
Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SignalComputation<T extends @Nullable Object> extends Serializable
Computes a signal value based on other signals. The computation is automatically re-run when any dependent signal changes.

Dependencies are automatically tracked - any signal whose value is accessed during the computation becomes a dependency. The computation is lazy and only runs when the signal value is accessed and the previous value might have been invalidated by dependent signal changes.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Computes the signal value, automatically tracking dependencies on other signals.
  • Method Details

    • compute

      T compute()
      Computes the signal value, automatically tracking dependencies on other signals.
      Returns:
      the computed value