net.sourceforge.plantuml.sequencediagram.graphic.InGroupablesStack 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.sequencediagram.graphic;
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.sequencediagram.InGroupableList;
class InGroupablesStack {
final private List inGroupableStack = new ArrayList<>();
public void addList(InGroupableList inGroupableList) {
for (InGroupableList other : inGroupableStack) {
other.addInGroupable(inGroupableList);
}
inGroupableStack.add(inGroupableList);
}
public void pop() {
final int idx = inGroupableStack.size() - 1;
inGroupableStack.remove(idx);
}
public void addElement(InGroupable inGroupable) {
for (InGroupableList groupingStructure : inGroupableStack) {
groupingStructure.addInGroupable(inGroupable);
}
}
public InGroupableList getTopGroupingStructure() {
if (inGroupableStack.size() == 0) {
return null;
}
return inGroupableStack.get(inGroupableStack.size() - 1);
}
}