net.sourceforge.plantuml.mda.MDAPackageImpl 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.mda;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import net.sourceforge.plantuml.abel.Entity;
import net.sourceforge.plantuml.api.mda.option2.MDAEntity;
import net.sourceforge.plantuml.api.mda.option2.MDAPackage;
public class MDAPackageImpl implements MDAPackage {
private final Collection entities = new ArrayList<>();
private final Entity group;
public MDAPackageImpl(Entity group) {
this.group = group;
for (Entity leaf : group.leafs()) {
entities.add(new MDAEntityImpl(leaf));
}
}
public Collection getEntities() {
return Collections.unmodifiableCollection(entities);
}
public String getName() {
if (group.isRoot()) {
return "";
}
return group.getName();
}
}