X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Foutput%2Ftemplate%2FForeachStatement.java;h=4c8b1027b5f7dfb3df420b309fffe699fad94d26;hb=7a9b55470434239a3dd260005932e9e6096a9921;hp=4a368cc9ac097e5390bca5452e4d53b0af7945a1;hpb=480cb29387c76ccc19f8fa8fb0abe8ae1b069730;p=gigi.git diff --git a/src/org/cacert/gigi/output/template/ForeachStatement.java b/src/org/cacert/gigi/output/template/ForeachStatement.java index 4a368cc9..4c8b1027 100644 --- a/src/org/cacert/gigi/output/template/ForeachStatement.java +++ b/src/org/cacert/gigi/output/template/ForeachStatement.java @@ -1,18 +1,30 @@ package org.cacert.gigi.output.template; import java.io.PrintWriter; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.cacert.gigi.localisation.Language; -import org.cacert.gigi.output.Outputable; -public final class ForeachStatement implements Outputable { +/** + * Outputs an {@link Outputable} multiple times based on a given + * {@link IterableDataset}. + */ +public final class ForeachStatement implements Translatable { private final String variable; private final TemplateBlock body; + /** + * Creates a new {@link ForeachStatement}. + * + * @param variable + * the variable to take the {@link IterableDataset} from. + * @param body + * the body to output multiple times. + */ public ForeachStatement(String variable, TemplateBlock body) { this.variable = variable; this.body = body; @@ -29,4 +41,9 @@ public final class ForeachStatement implements Outputable { } } } + + @Override + public void addTranslations(Collection s) { + body.addTranslations(s); + } }