package tudelft.mentalhealth.perfectfit; import java.io.IOException; /** * Contains a single goal line from the goals database. */ public class GoalLine { private final int id; private final String introduction; private final String goal; private final String how; private final Characteristics characteristics; /** * @param data list of string with values for id introduction goal how * godin_activity exercise_se exercise_identity extraversion * ttm_pa openness_to_experiences sitting_weekend age * household_income household_size. All values are assumed * normalized. * @throws IOException */ public GoalLine(String[] data) throws IOException { this.id = Integer.valueOf(data[0]); this.introduction = data[1]; this.goal = data[2]; this.how = data[3]; this.characteristics = new Characteristics(num(data[4]), num(data[5]), num(data[6]), num(data[7]), num(data[8]), num(data[9]), num(data[10]), num(data[11]), num(data[12]), num(data[13])); } private double num(String string) { return Double.valueOf(string); } @Override public String toString() { return "[" + id + ":" + introduction + " " + goal + " " + how + "," + characteristics + "]\n"; } public int getId() { return id; } public String getIntro() { return introduction; } public String getGoal() { return goal; } public String getHow() { return how; } public Characteristics characteristics() { return characteristics; } }