use of pcgen.core.doomsdaybook.WeightedDataValue in project pcgen by PCGen.
the class NameGenPanel method loadList.
private String loadList(Element list) throws DataConversionException {
pcgen.core.doomsdaybook.DDList dataList = new pcgen.core.doomsdaybook.DDList(allVars, list.getAttributeValue("title"), list.getAttributeValue("id"));
java.util.List<?> elements = list.getChildren();
for (final Object element : elements) {
Element child = (Element) element;
String elementName = child.getName();
if (elementName.equals("VALUE")) {
WeightedDataValue dv = new WeightedDataValue(child.getText(), child.getAttribute("weight").getIntValue());
List<?> subElements = child.getChildren("SUBVALUE");
for (final Object subElement1 : subElements) {
Element subElement = (Element) subElement1;
dv.addSubValue(subElement.getAttributeValue("type"), subElement.getText());
}
dataList.add(dv);
}
}
allVars.addDataElement(dataList);
return dataList.getId();
}
Aggregations