Class UnusedImportsCheck.Frame

    • Field Detail

      • declaredTypes

        private final java.util.Set<java.lang.String> declaredTypes
        Nested types declared in the current scope.
      • referencedTypes

        private final java.util.Set<java.lang.String> referencedTypes
        Set of references - possibly to imports or locally declared types.
    • Method Detail

      • addDeclaredType

        public void addDeclaredType​(java.lang.String type)
        Adds new inner type.
        Parameters:
        type - the type name
      • addReferencedType

        public void addReferencedType​(java.lang.String type)
        Adds new type reference to the current frame.
        Parameters:
        type - the type name
      • addReferencedTypes

        public void addReferencedTypes​(java.util.Collection<java.lang.String> types)
        Adds new inner types.
        Parameters:
        types - the type names
      • finish

        public void finish()
        Filters out all references to locally defined types.
      • pop

        public UnusedImportsCheck.Frame pop()
        Pulls all referenced types up, except those that are declared in this scope.
        Returns:
        the parent frame
      • isReferencedType

        public boolean isReferencedType​(java.lang.String type)
        Checks whether this type name is used in this frame.
        Parameters:
        type - the type name
        Returns:
        true if the type is used