Commits

Anonymous committed 4c5bdf8

Add useful toString() methods.

Comments (0)

Files changed (3)

core/src/org/javarosa/core/model/data/SelectOneData.java

 	public SelectOneData cast(UncastData data) throws IllegalArgumentException {
 		return new SelectOneData(new Selection(data.value));
 	}
+	
+	public String toString()
+	{
+		return "SelectOneData: " + (s == null ? "no selection" : s.toString());
+	}
 }

core/src/org/javarosa/core/model/data/helper/Selection.java

 		ExtUtil.writeString(out, getValue());
 		ExtUtil.writeNumeric(out, index);
 	}
+	
+	public String toString()
+	{
+		return this.choice.toString() + " (" + index + ")";
+	}
 }

core/src/org/javarosa/core/model/instance/TreeElement.java

 	public IAnswerData getValue() {
 		return value;
 	}
+	
+	public String toString()
+	{
+		return "TreeElement " + this.name + 
+				(enabled ? "" : ", disabled") +
+				(relevant ? "" : ", not relevant");
+	}
 
 }