Interface StatusUpdater

All Superinterfaces:
Context
All Known Implementing Classes:
DefaultContext

public interface StatusUpdater extends Context

The context allowing to inform the user about execution of a long-working method via some status line or its analog.

When possible, we recommend using ProgressUpdater instead, because that context is more abstract and does not require an algorithm to provide textual information, as this one. If you decide to process this context in some algorithm, you should keep in mind that the algorithm may be used in different countries, so the passed textual messages should either support localized versions for main languages, or be very brief and simple.

Author:
Daniel Alievsky
  • Method Details

    • updateStatus

      void updateStatus(String message)
      Equivalent to updateStatus(message, true).

      This method can throw NullPointerException, if its message argument is null, but it is not guaranteed.

      Parameters:
      message - some information message; must not be null.
    • updateStatus

      void updateStatus(String message, boolean force)
      Shows some information message to the user. The message should be one line and brief, to allow an application to show it inside a little status line.

      The force argument determines whether this information must be shown to the user with a guarantee. If this argument is false, this method may do nothing to save processing time when very often calls. Usual implementation of this method contains a time check (System.currentTimeMillis()) and, if !force, does nothing if the previous call (for the same context) was performed several tens of milliseconds ago. Please avoid too frequent calls of this method with force=true: millions of such calls may require long time.

      This method can throw NullPointerException, if its message argument is null, but it is not guaranteed.

      Parameters:
      message - some information message; must not be null.
      force - whether this information must be shown always (true) or may be lost (false).