ProgressEvent.java

  1. package org.docascode.api.event;

  2. public class ProgressEvent extends Event {

  3.     /**
  4.      * Constructs a prototypical Event.
  5.      *
  6.      * @param source The object on which the Event initially occurred.
  7.      * @throws IllegalArgumentException if source is null.
  8.      */
  9.     public ProgressEvent(Object source) {
  10.         super(source);
  11.     }

  12.     private int progress = 0;

  13.     private int total = 0;

  14.     public ProgressEvent setProgress(int progress){
  15.         this.progress = progress;
  16.         return this;
  17.     }

  18.     public int getProgress(){
  19.         return this.progress;
  20.     }

  21.     public ProgressEvent setTotal(int total){
  22.         this.total = total;
  23.         return this;
  24.     }

  25.     public int getTotal(){
  26.         return this.total;
  27.     }
  28. }