JAVA開発メモ
Timer のバックアップの現在との差分(No.1)
 

[トップ|一覧|単語検索|最終更新|バックアップ|ヘルプ]



  *java.util.Timer


  

  

  -cancel()

  -schedule(TimerTask task, Date time)

  -schedule(TimerTask task, Date firstTime, long period)

  -schedule(TimerTask task, long delay)

  -schedule(TimerTask task, long delay, long period)

  -scheduleAtFixedRate(TimerTask task, Date firstTime, long period)

  -scheduleAtFixedRate(TimerTask task, long delay, long period)

  


   import java.util.TimerTask;
  
   public class SampleTask extends TimerTask {
  
       public void run() {

       }
   }
  

   final String DATE_FORMAT = "yyyyMMdd HH:mm:ss";
   final String DATE_FORMAT = "yyyy/MM/dd HH:mm:ss";
   SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
  
   Timer timer = new Timer();
   TimerTask task = new SampleTask();
   timer.schedule(task, sdf.parse("20040101 00:00:00"));

   timer.schedule(task, sdf.parse("2004/01/01 00:00:00"));
  

   Timer timer = new Timer();
   timer.schedule(task, new Date(), 60000);
   TimerTask task = new SampleTask();

   timer.schedule(task, 0, 60000);

トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS

Modified by MT22(Moriwaki Takashi)

"PukiWiki" 1.3.7 Copyright © 2001,2002,2003 PukiWiki Developers Team. License is GNU/GPL.
Based on "PukiWiki" 1.3 by sng
Powered by PHP 7.4.33

HTML convert time to 0.002 sec.