Package arez

Class ObservableValue<T>

java.lang.Object
arez.Node
arez.ObservableValue<T>
All Implemented Interfaces:
Disposable

public final class ObservableValue<T> extends Node
The observable represents state that can be observed within the system.
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Dispose the element. See Disposable for a description of the implications.
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Return true if dispose() has been called on object.
      Returns:
      true if dispose has been called.
    • reportObserved

      public void reportObserved()
      Notify Arez that this observable has been "observed" in the current transaction. Before invoking this method, a transaction MUST be active but it may be read-only or read-write.
    • reportObservedIfTrackingTransactionActive

      Notify Arez that this observable has been "observed" if a tracking transaction is active.
    • preReportChanged

      @OmitSymbol(unless="arez.check_invariants") public void preReportChanged()
      Check that pre-conditions are satisfied before changing observable value. In production mode this will typically be a no-op. This method should be invoked before state is modified. Before invoking this method, a read-write transaction MUST be active.
    • reportChanged

      public void reportChanged()
      Notify Arez that this observable has changed. This is called when the observable has definitely changed. Before invoking this method, a read-write transaction MUST be active.