예제 #1
0
 /**
  * Creates a new named {@code Timer} which may be specified to be run as a
  * daemon thread.
  *
  * @param name the name of the {@code Timer}.
  * @param isDaemon true if {@code Timer}'s thread should be a daemon thread.
  * @throws NullPointerException is {@code name} is {@code null}
  */
 public Timer(String name, bool isDaemon) : base()
 {
     if (name == null)
     {
         throw new java.lang.NullPointerException("name is null");
     }
     this.impl      = new TimerImpl(name, isDaemon);
     this.finalizer = new FinalizerHelper(impl);
     java.lang.Thread t = new java.lang.Thread(new IAC_CallTimerCancelMethodRunnable(this.impl));
     java.lang.Runtime.getRuntime().addShutdownHook(t);
 }
예제 #2
0
 /**
     * Creates a new named {@code Timer} which may be specified to be run as a
     * daemon thread.
     *
     * @param name the name of the {@code Timer}.
     * @param isDaemon true if {@code Timer}'s thread should be a daemon thread.
     * @throws NullPointerException is {@code name} is {@code null}
     */
 public Timer(String name, bool isDaemon)
     : base()
 {
     if (name == null){
         throw new java.lang.NullPointerException("name is null");
     }
     this.impl = new TimerImpl(name, isDaemon);
     this.finalizer = new FinalizerHelper(impl);
     java.lang.Thread t = new java.lang.Thread (new IAC_CallTimerCancelMethodRunnable(this.impl));
     java.lang.Runtime.getRuntime().addShutdownHook(t);
 }