1 package club.wpia.gigi.output.template;
5 import club.wpia.gigi.localisation.Language;
8 * Generic implementation of {@link IterableDataset} that is fed by an array.
10 public class OutputableArrayIterable implements IterableDataset {
12 private Object[] content;
14 private String targetName;
16 private int index = 0;
19 * Creates a new {@link OutputableArrayIterable}.
22 * the objects to be iterated over.
24 * the variable where the contents of the array to be put in the
27 public OutputableArrayIterable(Object[] content, String targetName) {
28 this.content = content;
29 this.targetName = targetName;
33 public boolean next(Language l, Map<String, Object> vars) {
34 if (index >= content.length) {
37 vars.put(targetName, content[index]);