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

edu.stanford.protege.webprotege.util.Counter Maven / Gradle / Ivy

The newest version!
package edu.stanford.protege.webprotege.util;

/**
 * Matthew Horridge
 * Stanford Center for Biomedical Informatics Research
 * 9 Apr 2018
 */
public class Counter {

    private int counter;

    public void increment() {
        counter++;
    }

    /**
     * A convenience method that allows a counter the easily by used in streams as a lambda expression.
     * @param object An object that will be passed through this method.
     */
    public  T increment(T object) {
        counter++;
        return object;
    }

    public int getCounter() {
        return counter;
    }

    public void reset() {
        counter = 0;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy