private static final class UnusedImportsCheck.Frame extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.String> |
declaredTypes
Nested types declared in the current scope.
|
private UnusedImportsCheck.Frame |
parent
Parent frame.
|
private java.util.Set<java.lang.String> |
referencedTypes
Set of references - possibly to imports or locally declared types.
|
| Modifier | Constructor and Description |
|---|---|
private |
Frame(UnusedImportsCheck.Frame parent)
Private constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaredType(java.lang.String type)
Adds new inner type.
|
void |
addReferencedType(java.lang.String type)
Adds new type reference to the current frame.
|
void |
addReferencedTypes(java.util.Collection<java.lang.String> types)
Adds new inner types.
|
static UnusedImportsCheck.Frame |
compilationUnit()
Creates a new top-level frame for the compilation unit.
|
void |
finish()
Filters out all references to locally defined types.
|
boolean |
isReferencedType(java.lang.String type)
Checks whether this type name is used in this frame.
|
UnusedImportsCheck.Frame |
pop()
Pulls all referenced types up, except those that are declared in this scope.
|
UnusedImportsCheck.Frame |
push()
Creates new inner frame.
|
private final UnusedImportsCheck.Frame parent
private final java.util.Set<java.lang.String> declaredTypes
private final java.util.Set<java.lang.String> referencedTypes
private Frame(UnusedImportsCheck.Frame parent)
compilationUnit() to create a new top-level frame.parent - the parent framepublic void addDeclaredType(java.lang.String type)
type - the type namepublic void addReferencedType(java.lang.String type)
type - the type namepublic void addReferencedTypes(java.util.Collection<java.lang.String> types)
types - the type namespublic void finish()
public UnusedImportsCheck.Frame push()
public UnusedImportsCheck.Frame pop()
public boolean isReferencedType(java.lang.String type)
type - the type nametrue if the type is usedpublic static UnusedImportsCheck.Frame compilationUnit()
Copyright © 2001-2022. All Rights Reserved.