Class LogProgressMonitor

  • All Implemented Interfaces:
    AutoCloseable, org.nasdanika.common.Composeable<org.nasdanika.common.ProgressMonitor>, org.nasdanika.common.ProgressMonitor

    public class LogProgressMonitor
    extends Object
    implements org.nasdanika.common.ProgressMonitor
    Progress monitor reporting to a PrintStream, e.g. ``System.out``. This monitor indents sub-tasks and worked messages. It can be thought of as a hierarchical logger.
    Author:
    Pavel
    • Constructor Detail

      • LogProgressMonitor

        public LogProgressMonitor​(org.apache.maven.plugin.logging.Log log,
                                  int indent,
                                  int indentIncrement)
        Constructs a progress monitor for a given log.
    • Method Detail

      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface org.nasdanika.common.ProgressMonitor
      • split

        public org.nasdanika.common.ProgressMonitor split​(String taskName,
                                                          double size,
                                                          Object... data)
        Specified by:
        split in interface org.nasdanika.common.ProgressMonitor
      • formatDetail

        protected String formatDetail​(Object detail,
                                      String indent)
        Formats detail element for output. This implementation concatenates the indent with the detail.
        Parameters:
        detail -
        indent -
        Returns:
      • worked

        public void worked​(org.nasdanika.common.Status status,
                           double work,
                           String progressMessage,
                           Object... data)
        Specified by:
        worked in interface org.nasdanika.common.ProgressMonitor
      • setWorkRemaining

        public org.nasdanika.common.ProgressMonitor setWorkRemaining​(double size)
        Specified by:
        setWorkRemaining in interface org.nasdanika.common.ProgressMonitor
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.nasdanika.common.ProgressMonitor