Coverage Report - org.jtheque.core.managers.view.edt.SimpleTask
 
Classes in this File Line Coverage Branch Coverage Complexity
SimpleTask
0 %
0/2
N/A
1
SimpleTask$1
0 %
0/3
N/A
1
 
 1  
 package org.jtheque.core.managers.view.edt;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 /**
 20  
  * A task to be launched in EDT thread.
 21  
  *
 22  
  * @author Baptiste Wicht
 23  
  */
 24  0
 public abstract class SimpleTask {
 25  
     /**
 26  
      * Run the task.
 27  
      */
 28  
     public abstract void run();
 29  
 
 30  
     /**
 31  
      * Create a runnable to encapsulate the task.
 32  
      *
 33  
      * @return A Runnable containing the task.
 34  
      */
 35  
     public final Runnable asRunnable() {
 36  0
         return new Runnable() {
 37  
             @Override
 38  
             public void run() {
 39  0
                 SimpleTask.this.run();
 40  0
             }
 41  
         };
 42  
     }
 43  
 }