Class Insertions
java.lang.Object
org.checkerframework.afu.annotator.find.Insertions
A collection of
Insertion
s, 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 Insertion
s 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 TypeMethodDescriptionvoid
Add anInsertion
to this collection.void
addAll
(Collection<? extends Insertion> c) Add all the givenInsertion
s to this collection.forClass
(CompilationUnitTree cut, String qualifiedClassName) SelectsInsertion
s relevant to a given class.forOuterClass
(CompilationUnitTree cut, String qualifiedOuterClassName) SelectsInsertion
s relevant to a given outer class and its local classes.iterator()
int
size()
Returns the number ofInsertion
s in this collection.toList()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Insertions
public Insertions()
-
-
Method Details
-
forClass
SelectsInsertion
s relevant to a given class.- Parameters:
cut
- the current compilation unitqualifiedClassName
- the fully qualified class name- Returns:
Set
ofInsertion
s with anInClassCriterion
for the given class
-
forOuterClass
SelectsInsertion
s 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
Insertion
s with anInClassCriterion
for the given outer class or one of its local classes
-
add
Add anInsertion
to this collection. -
addAll
Add all the givenInsertion
s to this collection. -
size
public int size()Returns the number ofInsertion
s in this collection. -
iterator
-
toList
-