home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / Runnable.java < prev    next >
Text File  |  1996-05-03  |  2KB  |  49 lines

  1. /*
  2.  * @(#)Runnable.java    1.10 95/07/25  
  3.  *
  4.  * Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. package java.lang;
  21.  
  22. /**
  23.  * This interface is designed to provide a common protocol for Objects that wish to execute 
  24.  * code while they are active. For example, Runnable is implemented by class Thread.  
  25.  * Being active simply means that a thread has been started and has not yet been stopped. 
  26.  * <p>
  27.  * In addition, Runnable provides the means for a class to be active while 
  28.  * not subclassing Thread. A class that implements Runnable can run without
  29.  * subclassing Thread by instantiating a Thread instance and passing itself in
  30.  * as the target.  In most cases, the Runnable interface should be used if you are only planning 
  31.  * to override the run() method and no other Thread methods.  
  32.  * This is important because classes should not be subclassed
  33.  * unless the programmer intends on modifying or enhancing the fundamental
  34.  * behavior of the class.
  35.  * @see     Thread
  36.  * @version     1.10, 25 Jul 1995
  37.  * @author    Arthur van Hoff
  38.  */
  39. public
  40. interface Runnable {
  41.     /**
  42.      * The method that is executed when a Runnable object is activated.  The run() method
  43.      * is the "soul" of a Thread.  It is in this method that all of the action of a 
  44.      * Thread takes place.
  45.      * @see Thread#run
  46.      */
  47.     public abstract void run();
  48. }
  49.