PMD code sweep, #6 don't add MyWindow twice to MyApplication
[fanfix.git] / src / jexer / TTimer.java
index a86c132febbcfb31977ef6a73989e3846905d2ce..5d3dc134f9002bfb3c1e48a8eee1f1d0f02f9a2b 100644 (file)
@@ -35,6 +35,10 @@ import java.util.Date;
  */
 public final class TTimer {
 
+    // ------------------------------------------------------------------------
+    // Variables --------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * If true, re-schedule after every tick.  Note package private access.
      */
@@ -50,6 +54,36 @@ public final class TTimer {
      */
     private Date nextTick;
 
+    /**
+     * The action to perfom on a tick.
+     */
+    private TAction action;
+
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
+
+    /**
+     * Package private constructor.
+     *
+     * @param duration number of milliseconds to wait between ticks
+     * @param recurring if true, re-schedule this timer after every tick
+     * @param action to perform on next tick
+     */
+    TTimer(final long duration, final boolean recurring, final TAction action) {
+
+        this.recurring = recurring;
+        this.duration  = duration;
+        this.action    = action;
+
+        Date now = new Date();
+        nextTick = new Date(now.getTime() + duration);
+    }
+
+    // ------------------------------------------------------------------------
+    // TTimer -----------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Get the next time this timer needs to be ticked.  Note package private
      * access.
@@ -69,11 +103,6 @@ public final class TTimer {
         this.recurring = recurring;
     }
 
-    /**
-     * The action to perfom on a tick.
-     */
-    private TAction action;
-
     /**
      * Tick this timer.  Note package private access.
      */
@@ -88,21 +117,4 @@ public final class TTimer {
         }
     }
 
-    /**
-     * Package private constructor.
-     *
-     * @param duration number of milliseconds to wait between ticks
-     * @param recurring if true, re-schedule this timer after every tick
-     * @param action to perform on next tick
-     */
-    TTimer(final long duration, final boolean recurring, final TAction action) {
-
-        this.recurring = recurring;
-        this.duration  = duration;
-        this.action    = action;
-
-        Date now = new Date();
-        nextTick = new Date(now.getTime() + duration);
-    }
-
 }