harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r698582 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Timer.java
Date Wed, 24 Sep 2008 14:16:12 GMT
Author: tellison
Date: Wed Sep 24 07:16:11 2008
New Revision: 698582

URL: http://svn.apache.org/viewvc?rev=698582&view=rev
Log:
Add missing javadoc.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Timer.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Timer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Timer.java?rev=698582&r1=698581&r2=698582&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Timer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Timer.java Wed Sep
24 07:16:11 2008
@@ -344,10 +344,31 @@
         impl = new TimerImpl(false);
     }
 
+    /**
+     * Create a new timer with the given name and daemon status.
+     * 
+     * The name is given the timer's background thread and if the flag is true
+     * the thread is run as a daemon.
+     * 
+     * @param name
+     *            a name to associate with the timer thread.
+     * @param isDaemon
+     *            true if the timer thread should be a daemon, or false if it is
+     *            a regular thread that prevents the application terminating.
+     */
     public Timer(String name, boolean isDaemon) {
         impl = new TimerImpl(name, isDaemon);
     }
 
+    /**
+     * Create a new timer whose thread has the given name.
+     * 
+     * The name is given the timer's background thread, that is not run as a
+     * daemon.
+     * 
+     * @param name
+     *            a name to associate with the timer thread.
+     */
     public Timer(String name) {
         impl = new TimerImpl(name, false);
     }
@@ -361,6 +382,16 @@
         impl.cancel();
     }
 
+    /**
+     * Purging the timer eagerly removes cancelled tasks.
+     * 
+     * When a large number of tasks have been cancelled it may be helpful to
+     * explicitly purge them from the timer rather than let them be removed
+     * during normal expiry processing. This is a housekeeping task that does
+     * not affect the timer's schedule tasks.
+     * 
+     * @return the number of tasks that were purged.
+     */
     public int purge() {
         synchronized (impl) {
             return impl.purge();



Mime
View raw message