All Downloads are FREE. Search and download functionalities are using the official Maven repository.

proguard.classfile.visitor.MethodCounter Maven / Gradle / Ivy

Go to download

ProGuardCORE is a free library to read, analyze, modify, and write Java class files.

There is a newer version: 9.1.7
Show newest version
/*
 * ProGuard -- shrinking, optimization, obfuscation, and preverification
 *             of Java bytecode.
 *
 * Copyright (c) 2002-2021 Guardsquare NV
 */

package proguard.classfile.visitor;

import proguard.classfile.Clazz;
import proguard.classfile.Member;
import proguard.classfile.ProgramClass;
import proguard.classfile.ProgramMethod;
import proguard.util.Counter;

/**
 * This {@link MemberVisitor} counts the number of methods that have been visited.
 *
 * @author Ruben Pieters
 */
public class MethodCounter
implements   MemberVisitor,
             Counter
{
    private int count;


    // Implementations for Counter.

    @Override
    public int getCount()
    {
        return count;
    }


    // Implementations for MemberVisitor.

    @Override
    public void visitAnyMember(Clazz clazz, Member member) {}

    @Override
    public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
    {
        count++;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy