Class CachingBloatContext
java.lang.Object
EDU.purdue.cs.bloat.context.BloatContext
EDU.purdue.cs.bloat.context.PersistentBloatContext
EDU.purdue.cs.bloat.context.CachingBloatContext
- All Implemented Interfaces:
EditorContext, EDU.purdue.cs.bloat.inline.InlineContext
Does a lot of the same stuff as PersistentBloatContext except that
it manages the chaches of BLOAT objects. For example, when a
MethodEditor is no longer needed, it is removed from the cache if
it is not dirty. This context is meant to used in volatile memory.
-
Field Summary
FieldsFields inherited from class PersistentBloatContext
classEditors, classInfos, DB_COMMIT, fieldEditors, fieldInfos, hierarchy, methodEditors, methodInfosFields inherited from class BloatContext
callGraph, DEBUG, ignoreClasses, ignoreFields, ignoreMethods, ignorePackages, ignoreSystem, inlineStats, loader, roots -
Constructor Summary
ConstructorsConstructorDescriptionCachingBloatContext(ClassInfoLoader loader, Collection classes, boolean closure) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()Commits all changes made to classes, methods, and fields.voidClasses that are ignored are not committed.voidCommits the changes made to a field.voidcommit(MethodInfo info) Commits the changes made to a method.Returns a ClassEditor used to edit a class described by a given ClassInfo.Returns a FieldEditor for editing a field.Returns a FieldEditor for editing a FieldInfo.editMethod(MemberRef method) Returns a MethodEditor for editing a method.editMethod(MethodInfo info) Returns a MethodEditor for editing a method.Returns aClassEditorfor editing a new class with the given name.voidSignals that we are done editing a class.voidSignals that we are done editing a field.voidrelease(MethodInfo info) Signals that we are done editing a method.toString()Return a textual description of all of the caches.Methods inherited from class PersistentBloatContext
addClasses, comm, commitDirty, editClass, editClass, getHierarchy, loadClass, newClassInfo, releaseMethods inherited from class BloatContext
addIgnoreClass, addIgnoreField, addIgnoreMethod, addIgnorePackage, db, getCallGraph, getInlineStats, ignoreClass, ignoreField, ignoreMethod, isSystem, main, setIgnoreSystem, setRootMethods
-
Field Details
-
classRC
-
methodRC
-
fieldRC
-
-
Constructor Details
-
CachingBloatContext
Constructor.- Parameters:
loader- Used to load classesclasses- Some initial classes in the contextclosure- Do we look for the maximum number of classes?
-
-
Method Details
-
newClass
Description copied from interface:EditorContextReturns aClassEditorfor editing a new class with the given name. It will override any class with the given name that is already being edited.- Specified by:
newClassin interfaceEditorContext- Overrides:
newClassin classPersistentBloatContext
-
editClass
Description copied from interface:EditorContextReturns a ClassEditor used to edit a class described by a given ClassInfo.- Specified by:
editClassin interfaceEditorContext- Overrides:
editClassin classPersistentBloatContext
-
editMethod
Description copied from interface:EditorContextReturns a MethodEditor for editing a method.- Specified by:
editMethodin interfaceEditorContext- Overrides:
editMethodin classPersistentBloatContext- Throws:
NoSuchMethodException
-
editMethod
Description copied from interface:EditorContextReturns a MethodEditor for editing a method.- Specified by:
editMethodin interfaceEditorContext- Overrides:
editMethodin classPersistentBloatContext
-
editField
Description copied from interface:EditorContextReturns a FieldEditor for editing a field.- Specified by:
editFieldin interfaceEditorContext- Overrides:
editFieldin classPersistentBloatContext- Throws:
NoSuchFieldException
-
editField
Description copied from interface:EditorContextReturns a FieldEditor for editing a FieldInfo.- Specified by:
editFieldin interfaceEditorContext- Overrides:
editFieldin classPersistentBloatContext
-
release
Description copied from interface:EditorContextSignals that we are done editing a class. The object used to model it may be reclaimed.- Specified by:
releasein interfaceEditorContext- Overrides:
releasein classPersistentBloatContext
-
release
Description copied from interface:EditorContextSignals that we are done editing a method. The object used to model it may be reclaimed.- Specified by:
releasein interfaceEditorContext- Overrides:
releasein classPersistentBloatContext
-
release
Description copied from interface:EditorContextSignals that we are done editing a field. The object used to model it may be reclaimed.- Specified by:
releasein interfaceEditorContext- Overrides:
releasein classPersistentBloatContext
-
commit
Description copied from class:PersistentBloatContextClasses that are ignored are not committed.- Specified by:
commitin interfaceEditorContext- Overrides:
commitin classPersistentBloatContext- See Also:
-
commit
Description copied from interface:EditorContextCommits the changes made to a method.- Specified by:
commitin interfaceEditorContext- Overrides:
commitin classPersistentBloatContext
-
commit
Description copied from interface:EditorContextCommits the changes made to a field.- Specified by:
commitin interfaceEditorContext- Overrides:
commitin classPersistentBloatContext
-
commit
public void commit()Description copied from interface:EditorContextCommits all changes made to classes, methods, and fields.- Specified by:
commitin interfaceEditorContext- Overrides:
commitin classPersistentBloatContext
-
toString
-