01 
02 /*
03  *  JScripter Standard 1.0 - To Script In Java
04  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
05  *  
06  *  This program is free software: you can redistribute it and/or modify
07  *  it under the terms of the GNU Affero General Public License as published by
08  *  the Free Software Foundation, either version 3 of the License, or
09  *  (at your option) any later version.
10  *  
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU Affero General Public License for more details.
15  *  
16  *  You should have received a copy of the GNU Affero General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 package js;
21 
22 /**
23  * <p>A <b>normal</b> abstract class helping re-compilers in their finalization mechanisms.</p>
24  * <p>Subclasses of a disposable class is disposable. Objects of a disposable class is disposable.
25  * Members of a disposable class can only access disposable classes but can be accessed by members 
26  * of any non-disposable classes.</p>
27  * <p>The <b>opaque</b> classes in this library inherit this class, and therefore are naturally 
28  * disposable.</p>
29  *
30  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
31  * 
32  * @javascript In its finalization mechanism, a re-compiler must ignore the <tt>finalize</tt> methods 
33  * of disposable classes and not try to garbage collect any disposable objects.
34  */
35 
36 public abstract class Disposable
37 {
38     /**
39      * <p>The default constructor to create a disposable object.</p>
40      * @since 1.0
41      * @javascript Re-compilers must treat this construct as <b>normal</b> unless the concrete subclass
42      * is <b>opaque</b>.
43      */
44     protected Disposable() {}
45 
46     /**
47      * <p>An empty method to prevent subclasses from overriding.</p>
48      * @since 1.0
49      * @javascript Re-compilers must ignore any unnecessary invocations to this method. 
50      */
51     @Override
52     protected final void finalize() {}
53 }