diff src/org/tmatesoft/hg/util/CancelSupport.java @ 215:41a778e3fd31

Issue 5: Facilities for progress and cancellation. More specific exceptions. Exceptions from callbacks as RuntimeException
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 17 May 2011 00:56:54 +0200
parents 1a7a9a20e1f9
children f9f3e9b67ccc
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/util/CancelSupport.java	Mon May 16 21:10:36 2011 +0200
+++ b/src/org/tmatesoft/hg/util/CancelSupport.java	Tue May 17 00:56:54 2011 +0200
@@ -39,7 +39,7 @@
 		/**
 		 * Obtain non-null cancel support object.
 		 * 
-		 * @param target any object (or <code>null</code>) that might have cancel support
+		 * @param target any object (or <code>null</code>) that might have cancel support. For <code>null</code>, returns an instance than never cancels.
 		 * @return target if it's capable checking cancellation status or no-op implementation that never cancels.
 				 */
 		public static CancelSupport get(Object target) {
@@ -58,4 +58,8 @@
 			};
 		}
 	}
+
+	interface Target<T> {
+		T set(CancelSupport cs);
+	}
 }