예제 #1
0
  public Element saveAsXML() {
    Element retVal = new Element("probabilityGenerator");
    retVal.setAttribute("type", getClass().getName());

    retVal.addElement(XMLUtilities.writeInt("direction", direction));
    retVal.addElement(XMLUtilities.writeDouble("lambda", lambda));
    retVal.addElement(XMLUtilities.writeBoolean("lambdaTableEnabled", lambdaTableEnabled));
    retVal.addElement(lambdaTable.saveAsXML());

    return retVal;
  }
예제 #2
0
  @Override
  public Element saveAsXML() {
    Element retVal = new Element("generator");
    retVal.setAttribute("type", getClass().getName());

    retVal.addElement(XMLUtilities.writeInt("listType", getListType()));
    retVal.addElement(XMLUtilities.writeInt("index", index));
    retVal.addElement(XMLUtilities.writeInt("direction", direction));

    Element items = new Element("listItems");

    for (Iterator it = listItems.iterator(); it.hasNext(); ) {
      Double item = (Double) it.next();

      items.addElement("item").setText(item.toString());
    }

    retVal.addElement(items);

    return retVal;
  }