net.sourceforge.plantuml.sequencediagram.teoz.Stairs 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.teoz;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class Stairs {
private final List values = new ArrayList<>();
public void addStep(Step step) {
if (step.getIndent() < 0) {
throw new IllegalArgumentException();
}
if (values.size() > 0) {
final double lastY = values.get(values.size() - 1).getValue();
if (step.getValue() <= lastY) {
// throw new IllegalArgumentException();
return;
}
}
values.add(step);
}
public int getMaxIndent() {
int max = Integer.MIN_VALUE;
for (Step step : values) {
final int v = step.getIndent();
if (v > max) {
max = v;
}
}
return max;
}
public Collection getSteps() {
return Collections.unmodifiableCollection(values);
}
}