core: import edu.neu.ccs.demeter.dj.*; import edu.neu.ccs.demeter.*; add: class AverageVisitorDJ extends Visitor { protected CountingVisitorDJ cV; public CountingVisitorDJ get_cV() {{ return cV; }} public void set_cV(CountingVisitorDJ new_cV) {{ cV = new_cV; }} protected SummingVisitorDJ sV; public SummingVisitorDJ get_sV() {{ return sV; }} public void set_sV(SummingVisitorDJ new_sV) {{ sV = new_sV; }} protected float current; public float get_current() {{ return current; }} public void set_current(float new_current) {{ current = new_current; }} public constructor AverageVisitorDJ() {{ super(); }} public constructor AverageVisitorDJ(CountingVisitorDJ cV, SummingVisitorDJ sV, float current) {{ super(); set_cV(cV); set_sV(sV); set_current(current); }} public static AverageVisitorDJ parse(java.io.Reader in) throws ParseException {{ return new Parser(in)._AverageVisitorDJ(); }} public static AverageVisitorDJ parse(java.io.InputStream in) throws ParseException {{ return new Parser(in)._AverageVisitorDJ(); }} public static AverageVisitorDJ parse(String s) {{ try { return parse(new java.io.StringReader(s)); } catch (ParseException e) { throw new RuntimeException(e.toString()); } }} {{ void update() { current = (float) this.get_sV().get_total()/ (float) this.get_cV().get_total(); System.out.println(current + " = partial result"); } ; public void before(Weight o) { update(); } public Object getReturnValue() {return new Float(current);} }} {{ void universal_trv0_bef(UniversalVisitor _v_) { ((UniversalVisitor) _v_).before(this); } }} {{ void universal_trv0_aft(UniversalVisitor _v_) { ((UniversalVisitor) _v_).after(this); } }} {{ void universal_trv0(UniversalVisitor _v_) { universal_trv0_bef(_v_); ((UniversalVisitor) _v_).before_cV(this, cV); cV.universal_trv0(_v_); ((UniversalVisitor) _v_).after_cV(this, cV); ((UniversalVisitor) _v_).before_sV(this, sV); sV.universal_trv0(_v_); ((UniversalVisitor) _v_).after_sV(this, sV); ((UniversalVisitor) _v_).before_current(this, current); ((UniversalVisitor) _v_).after_current(this, current); universal_trv0_aft(_v_); } }} }