net.dontdrinkandroot.utils.oldprogressmonitor.impl

## Class AbstractProgressMonitor

- java.lang.Object
- - net.dontdrinkandroot.utils.oldprogressmonitor.impl.AbstractProgressMonitor

All Implemented Interfaces:
  Serializable, ProgressMonitor

Direct Known Subclasses:
  ConsoleMonitor, LogMonitor, SimpleMonitor, SingleLineConsoleMonitor

    public abstract class AbstractProgressMonitor
    extends Object
    implements ProgressMonitor

Abstract `ProgressMonitor` that implements very common functionality.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`AbstractProgressMonitor()` Default Constructor.

### Method Summary

Methods
`protected void` `doMessageChanged()` Hook that is invoked after the message has changed.
`protected void` `doProgressChanged()` Hook that is invoked after the progress has changed.
`String` `getMessage()` Get the current progress message.
`Integer` `getProgress()` Retrieve the current progress percentage.
`ProgressStatus` `getProgressStatus()` Get the current progress status.
`int` `getRangeEnd()` Get the upper bound of the current range.
`int` `getRangeStart()` Get the lower bound of the current range.
`boolean` `isDone()` Flag to denote that the task has been done.
`void` `setDone(boolean done)`
`void` `setMessage(String msg)` Set the current progress message.
`void` `setProgress(int percent)` Set the current progress percentage.
`void` `setRange(int start, int end)` Specify which range we are currently working on.

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

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

### Constructor Detail

#### AbstractProgressMonitor

    public AbstractProgressMonitor()

Default Constructor. Initialize to defaults.

### Method Detail

#### getMessage

    public final String getMessage()

Description copied from interface: `ProgressMonitor`
Get the current progress message.

Specified by:
  `getMessage` in interface `ProgressMonitor`

#### getProgress

    public final Integer getProgress()

Description copied from interface: `ProgressMonitor`
Retrieve the current progress percentage.

Specified by:
  `getProgress` in interface `ProgressMonitor`

#### getProgressStatus

    public ProgressStatus getProgressStatus()

Description copied from interface: `ProgressMonitor`
Get the current progress status.

Specified by:
  `getProgressStatus` in interface `ProgressMonitor`

#### getRangeEnd

    public final int getRangeEnd()

Description copied from interface: `ProgressMonitor`
Get the upper bound of the current range.

Specified by:
  `getRangeEnd` in interface `ProgressMonitor`

#### getRangeStart

    public final int getRangeStart()

Description copied from interface: `ProgressMonitor`
Get the lower bound of the current range.

Specified by:
  `getRangeStart` in interface `ProgressMonitor`

#### setMessage

    public final void setMessage(String msg)

Description copied from interface: `ProgressMonitor`
Set the current progress message.

Specified by:
  `setMessage` in interface `ProgressMonitor`

#### doMessageChanged

    protected void doMessageChanged()

Hook that is invoked after the message has changed.

#### setProgress

    public final void setProgress(int percent)

Description copied from interface: `ProgressMonitor`
Set the current progress percentage.

Specified by:
  `setProgress` in interface `ProgressMonitor`

#### doProgressChanged

    protected void doProgressChanged()

Hook that is invoked after the progress has changed.

#### setRange

    public final void setRange(int start,
                int end)

Description copied from interface: `ProgressMonitor`
Specify which range we are currently working on. This can be useful if a `ProgressMonitor` is shared among a larger set of tasks so each subtask can operate on a specific range. For example if the current range if from 0 to 50 and the progress is set to 50 the overall progress that can be retrieved by getProgress is 25.

Specified by:
  `setRange` in interface `ProgressMonitor`
Parameters:
  `start` - The lower bound of the range.
  `end` - The upper bound of the range.

#### isDone

    public boolean isDone()

Description copied from interface: `ProgressMonitor`
Flag to denote that the task has been done.

Specified by:
  `isDone` in interface `ProgressMonitor`

#### setDone

    public void setDone(boolean done)

Specified by:
  `setDone` in interface `ProgressMonitor`