org.cpsolver.ifs.util

## Class ProgressWriter

- java.lang.Object
- - org.cpsolver.ifs.util.ProgressWriter

- All Implemented Interfaces:
    ProgressListener

      public class ProgressWriter
      extends Object
      implements ProgressListener

  Prints current progres to `PrintStream`.
  Example usage:

       Progress.getInstance().addProgressListener(new ProgressWriter(System.out));

  Example output:

       Reading course.pl ...       :
       Reading altcourse.pl ...    :
       Reading room.pl ...         :
       Creating rooms ...          : ................................................
       Creating variables ...      : ................................................
       Reading students.pl ...     :
       Reading jenr.pl ...         :
       Creating jenrl constraints .: ................................................
       Reading add.pl ...          :
       Creating group constraints .: ................................................
       Creating initial assignment : ................................................
       Creating dept. spread constr: ................................................
       Input data loaded           : ................................................
       Initializing solver         :
       Searching for initial soluti: ................................................
       Improving found solution ...: ................................................
       Improving found solution ...: ................................................
       Improving found solution ...: ...................................

  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2006 - 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  Author:
    Tomáš Müller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProgressWriter(PrintStream out)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `phaseChanged(String phase)` Progress phase is changed
    `void` | `progressChanged(long currentProgress, long maxProgress)` Progress bar is changed
    `void` | `progressMessagePrinted(Progress.Message msg)` Progress message is printed
    `void` | `progressRestored()` Progress is restored
    `void` | `progressSaved()` Progress is saved
    `void` | `statusChanged(String status)` Progress status is changed

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProgressWriter

          public ProgressWriter(PrintStream out)

  - ### Method Detail

    - #### statusChanged

          public void statusChanged(String status)

      Description copied from interface: `ProgressListener`
      Progress status is changed
      Specified by:
        `statusChanged` in interface `ProgressListener`
      Parameters:
        `status` - current status name

    - #### phaseChanged

          public void phaseChanged(String phase)

      Description copied from interface: `ProgressListener`
      Progress phase is changed
      Specified by:
        `phaseChanged` in interface `ProgressListener`
      Parameters:
        `phase` - current phase name

    - #### progressChanged

          public void progressChanged(long currentProgress,
                                      long maxProgress)

      Description copied from interface: `ProgressListener`
      Progress bar is changed
      Specified by:
        `progressChanged` in interface `ProgressListener`
      Parameters:
        `currentProgress` - current progress
        `maxProgress` - maximum progress in this phase

    - #### progressSaved

          public void progressSaved()

      Description copied from interface: `ProgressListener`
      Progress is saved
      Specified by:
        `progressSaved` in interface `ProgressListener`

    - #### progressRestored

          public void progressRestored()

      Description copied from interface: `ProgressListener`
      Progress is restored
      Specified by:
        `progressRestored` in interface `ProgressListener`

    - #### progressMessagePrinted

          public void progressMessagePrinted(Progress.Message msg)

      Description copied from interface: `ProgressListener`
      Progress message is printed
      Specified by:
        `progressMessagePrinted` in interface `ProgressListener`
      Parameters:
        `msg` - a message to print