< prev index next >
modules/graphics/src/main/java/javafx/concurrent/Service.java
Print this page
@@ -99,22 +99,23 @@
* <p>
* Because a Service is intended to simplify declarative use cases, subclasses
* should expose as properties the input parameters to the work to be done.
* For example, suppose I wanted to write a Service which read the first line
* from any URL and returned it as a String. Such a Service might be defined,
- * such that it had a single property, <code>url</code>. It might be implemented
+ * such that it had a single property, {@code url}. It might be implemented
* as:
+ * </p>
* <pre><code>
* public static class FirstLineService extends Service<String> {
* private StringProperty url = new SimpleStringProperty(this, "url");
* public final void setUrl(String value) { url.set(value); }
* public final String getUrl() { return url.get(); }
* public final StringProperty urlProperty() { return url; }
*
* protected Task createTask() {
* final String _url = getUrl();
- * return new Task<String>() {
+ * return new Task<String>() {
* protected String call() throws Exception {
* URL u = new URL(_url);
* BufferedReader in = new BufferedReader(
* new InputStreamReader(u.openStream()));
* String result = in.readLine();
@@ -123,17 +124,16 @@
* }
* };
* }
* }
* </code></pre>
- * </p>
* <p>
* The Service by default uses a thread pool Executor with some unspecified
* default or maximum thread pool size. This is done so that naive code
* will not completely swamp the system by creating thousands of Threads.
* </p>
- * @param <V>
+ * @param <V> the type of object returned by the Service.
* @since JavaFX 2.0
*/
public abstract class Service<V> implements Worker<V>, EventTarget {
/**
* Logger used in the case of some uncaught exceptions
< prev index next >