// copied from AlgoInterationList.java // TODO should it be centralised? private void setListElement(int index, double value, double exp) { GeoList listElement; if (index < outputList.getCacheSize()) { // use existing list element listElement = (GeoList) outputList.getCached(index); listElement.clear(); } else { // create a new list element listElement = new GeoList(cons); listElement.setParentAlgorithm(this); listElement.setConstructionDefaults(); listElement.setUseVisualDefaults(false); } outputList.add(listElement); GeoNumeric prime = new GeoNumeric(cons); prime.setValue(value); GeoNumeric exponent = new GeoNumeric(cons); exponent.setValue(exp); listElement.add(prime); listElement.add(exponent); }
/** * Add an element to the end of a GeoList * * @param list the GeoList * @param obj the element to add */ public static void appendToList(GeoList list, GeoElement obj) { list.add(obj); }