Adding ParameterizedTypeImpl to getGenericSuperclass method.
[jpf-core.git] / src / main / gov / nasa / jpf / vm / Statics.java
1 /*
2  * Copyright (C) 2014, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The Java Pathfinder core (jpf-core) platform is licensed under the
7  * Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  * 
10  *        http://www.apache.org/licenses/LICENSE-2.0. 
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and 
16  * limitations under the License.
17  */
18 package gov.nasa.jpf.vm;
19
20 /**
21  * abstraction for the container of StaticElementInfos, which manages static fields.
22  * Note that there is a Statics instance per ClassLoaderInfo, i.e. ids are only unique within each
23  * ClassLoader namespace.
24  * 
25  * This container is only growing - we don't remove/recycle classes yet
26  * 
27  * Since Statics instances have to be obtained from their respective ClassLoaderInfo, and
28  * ClassLoaderInfos are the ones that map type names to ClassInfos, Statics does not include
29  * methods for name lookup. This allows implementors to use efficient lookup based on the numerical
30  * ClassInfo id (which is only unique within this Statics / ClassLoader namespace)
31  */
32 public interface Statics extends Iterable<ElementInfo> {
33
34   //--- construction
35   
36   /**
37    * startup classes are registered and initialized in two steps since object
38    * creation has to be deferred until we have at least Object and Class ClassInfos
39    */
40   StaticElementInfo newStartupClass (ClassInfo ci, ThreadInfo ti);
41   
42   /**
43    * this returns the search global id which is unique within this ClassLoader namespace.
44    * This id is also stored in the respective java.lang.Class object
45    */
46   StaticElementInfo newClass (ClassInfo ci, ThreadInfo ti, ElementInfo eiClsObj);
47   
48   
49   //--- accessors 
50   
51   /**
52    * get an ElementInfo that might or might not be suitable for modification. This should only
53    * be used when retrieving field values. The 'id' argument has to be the result of a previous 'newClass()' call
54    */
55   StaticElementInfo get (int id);
56   
57   /**
58    * get an ElementInfo that is guaranteed to be modifiable. This should be used when modifying
59    * field values.  The 'id' argument has to be the result of a previous 'newClass()' call
60    */
61   StaticElementInfo getModifiable (int id);
62
63   
64   //--- housekeeping
65   
66   Iterable<StaticElementInfo> liveStatics();
67   
68   void markRoots (Heap heap);
69   void cleanUpDanglingReferences (Heap heap);
70   
71   
72   //--- state management
73   
74   Memento<Statics> getMemento(MementoFactory factory);
75   Memento<Statics> getMemento();
76   
77   int size();
78 }