![JAR search and dependency download from the Maven repository](/logo.png)
com.g2forge.alexandria.java.resource.CountResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ax-java Show documentation
Show all versions of ax-java Show documentation
Standard Java library and the basis of the ${alexandria.name} project.
package com.g2forge.alexandria.java.resource;
import com.g2forge.alexandria.java.close.ICloseable;
public class CountResource implements ICloseableResource {
protected int nesting;
public void close(int previous) {
this.nesting = previous;
}
@Override
public Integer get() {
return nesting;
}
@Override
public ICloseable open(Integer value) {
final int previous = nesting;
this.nesting += value;
return () -> close(previous);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy