Interface Changes

All Known Implementing Classes:
ChangesImpl

public interface Changes
Contains change related functionality of this object graph. The change API of an object can be accessed via the vmf() method:

 VObject o = ...
 Change r = o.vmf().change()
 
*
  • Method Summary

    Modifier and Type
    Method
    Description
    vjavax.observer.Subscription
    Adds the specified change listener.
    vjavax.observer.Subscription
    addListener​(ChangeListener l, boolean recursive)
    Adds the specified change listener.
    eu.mihosoft.vcollections.VList<Change>
    all()
    Returns all changes to the model (observable collection) that were recorded since the last start() call.
    void
    Removes all recorded changes (also removes transactions).
    boolean
    Indicates whether model versioning is enabled.
    Returns the model version.
    void
    Publishes a transaction that consists of all changes since the last startTransaction() or publishTransaction() call.
    void
    Starts recording changes.
    void
    Starts a new transaction.
    void
    Stops recording changes.
    eu.mihosoft.vcollections.VList<Transaction>
    Returns all model transactions (observable collection) that were published since the last start() call.
  • Method Details

    • addListener

      vjavax.observer.Subscription addListener(ChangeListener l)
      Adds the specified change listener. Listeners will be notified about changes regardless of whether change recording is enabled. This allows to react to and/or undo specific changes without the overhead of storing all previous events in a collection. The listener registers with all objects of the current object graph.
      Parameters:
      l - the listener to add
      Returns:
      a subscription which allows to unsubscribe the specified listener
    • addListener

      vjavax.observer.Subscription addListener(ChangeListener l, boolean recursive)
      Adds the specified change listener. Listeners will be notified about changes regardless of whether change recording is enabled. This allows to react to and/or undo specific changes without the overhead of storing all previous events in a collection. Optionally the listener registers with all objects of the current object graph.
      Parameters:
      l - the listher to add
      recursive - determines whether to add the listener recuirsively to all objects of the current object graph
      Returns:
      a subscription which allows to unsubscribe the specified listener
    • start

      void start()
      Starts recording changes. Previously recorded changes will be removed (also removes transactions).
      See Also:
      stop()
    • startTransaction

      void startTransaction()
      Starts a new transaction.
      See Also:
      Transaction, publishTransaction()
    • publishTransaction

      void publishTransaction()
      Publishes a transaction that consists of all changes since the last startTransaction() or publishTransaction() call.
      See Also:
      Transaction, startTransaction()
    • stop

      void stop()
      Stops recording changes. Unpublished transactions will be published.
      See Also:
      start()
    • all

      eu.mihosoft.vcollections.VList<Change> all()
      Returns all changes to the model (observable collection) that were recorded since the last start() call.
      Returns:
      all changes to the model (observable collection) that were recorded since the last start() call
    • transactions

      eu.mihosoft.vcollections.VList<Transaction> transactions()
      Returns all model transactions (observable collection) that were published since the last start() call.
      Returns:
      all model transactions (observable collection)
    • clear

      void clear()
      Removes all recorded changes (also removes transactions).
    • modelVersion

      ModelVersion modelVersion()
      Returns the model version.
      Returns:
      model version
    • isModelVersioningEnabled

      boolean isModelVersioningEnabled()
      Indicates whether model versioning is enabled.
      Returns:
      true if model versioning is enabled; false otherwise