Class Insertions
java.lang.Object
org.checkerframework.afu.annotator.find.Insertions
A collection of
Insertions, indexed by outer class and inner class. It has methods to
select Insertions for a given class (forClass(com.sun.source.tree.CompilationUnitTree, java.lang.String)) or for an outer class along with its
local classes (forOuterClass(com.sun.source.tree.CompilationUnitTree, java.lang.String)). When a single JAIF stores annotations for many source
files, this class reduces the number of insertions to be considered for any AST node.
The class now serves a second purpose, which should probably be separated out: It attaches
ASTPath-based inner type Insertions to a TypedInsertion on the outer type
if one exists (see organizeTypedInsertions(CompilationUnitTree, String, Collection).
Since getting these insertions right depends on this organization, this class is now essential
for correctness, not merely for performance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd anInsertionto this collection.voidaddAll(Collection<? extends Insertion> c) Add all the givenInsertions to this collection.forClass(CompilationUnitTree cut, String qualifiedClassName) SelectsInsertions relevant to a given class.forOuterClass(CompilationUnitTree cut, String qualifiedOuterClassName) SelectsInsertions relevant to a given outer class and its local classes.iterator()intsize()Returns the number ofInsertions in this collection.toList()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Insertions
public Insertions()
-
-
Method Details
-
forClass
SelectsInsertions relevant to a given class.- Parameters:
cut- the current compilation unitqualifiedClassName- the fully qualified class name- Returns:
SetofInsertions with anInClassCriterionfor the given class
-
forOuterClass
SelectsInsertions relevant to a given outer class and its local classes.- Parameters:
cut- the current compilation unitqualifiedOuterClassName- the fully qualified outer class name- Returns:
- set of
Insertions with anInClassCriterionfor the given outer class or one of its local classes
-
add
Add anInsertionto this collection. -
addAll
Add all the givenInsertions to this collection. -
size
public int size()Returns the number ofInsertions in this collection. -
iterator
-
toList
-