net.sourceforge.plantuml.klimt.creole.CreoleContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.klimt.creole;
import java.util.ArrayList;
import java.util.List;
public class CreoleContext {
private final List stack = new ArrayList<>();
public int getLocalNumber(int order) {
ensureStackOk(order);
final int n = stack.get(order);
stack.set(order, n + 1);
return n;
}
private void ensureStackOk(int order) {
while (stack.size() <= order) {
stack.add(0);
}
while (stack.size() > order + 1) {
stack.remove(order + 1);
}
}
}