1 33 34 package edu.rice.cs.util.swing; 35 36 import javax.swing.ProgressMonitor ; 37 38 62 public abstract class AsyncTask<ParamType, ResType> { 63 64 private String _name; 65 66 67 public AsyncTask() { this("Untitled"); } 68 69 72 public AsyncTask(String name) { _name = name; } 73 74 90 public abstract ResType runAsync(ParamType param, IAsyncProgress monitor) throws Exception ; 91 92 96 public abstract void complete(AsyncCompletionArgs<ResType> args); 97 98 105 public abstract String getDiscriptionMessage(); 106 107 110 public String getName() { return _name; } 111 112 115 public int getMinProgress() { return 0; } 116 117 120 public int getMaxProgress() { return 100; } 121 122 public String toString() { 123 return getClass().getName() + ": " + getName() + " (@" + System.identityHashCode(this) + ")"; 124 } 125 } | Popular Tags |