package org.uncertweb.ps.data; import java.util.ArrayList; import java.util.List; public class MultipleInput extends Input { private List<Object> objects; public MultipleInput(String name) { super(name); objects = new ArrayList<Object>(); } public MultipleInput(String name, List<? extends Object> objects) { super(name); this.objects = new ArrayList<Object>(objects); } public void addObject(Object o) { objects.add(o); } public List<Object> getObjects() { return objects; } public <T> List<T> getObjectsAs(Class<T> type) { List<T> list = new ArrayList<T>(); for (Object o : objects) { list.add(type.cast(o)); } return list; } }