home *** CD-ROM | disk | FTP | other *** search
/ Internet News 1998 November / InternetNews_1998_11.iso / pc / Java / Corso / SingletonApplication.java < prev   
Text File  |  1998-11-22  |  1KB  |  53 lines

  1. /*
  2. **    Program:        [application name]
  3. **    Version:        [version]
  4. **    Author:        [author name]
  5. **    Address:        [e-mail address]
  6. **    Created on:        [date of creation]
  7. **    Modified on:    [date of last modification]
  8. **    Language:        Java (jdk [version])
  9. **    -------------------------------------------------------------
  10. **    (c) 1998 - All rights reserved 
  11. **    -------------------------------------------------------------
  12. **    I make 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. I 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. **    Permission to use, copy, and distribute this software for
  20. **    NON-COMMERCIAL purposes and without fee is hereby granted
  21. **    provided that this copyright notice appears in all copies.
  22. */
  23.  
  24. class ApplicationClass
  25. {
  26.     private static ApplicationClass cvSingleton ;
  27.  
  28.     public static void main( String[] args )
  29.     {
  30.         create( ) ;
  31.     }
  32.  
  33.     public static void create( )
  34.     { 
  35.         if ( cvSingleton == null )
  36.         {
  37.             cvSingleton = new ApplicationClass( ) ; 
  38.         }
  39.     }
  40.  
  41.     public static void destroy( )
  42.     {
  43.         cvSingleton = null ;
  44.     }
  45.  
  46.     private ApplicationClass( )
  47.     {
  48.         // Application body
  49.     }
  50. }
  51.  
  52.  
  53.