// ** This class was generated with DemFGen (vers:02/03/2009) package gen; import edu.neu.ccs.demeterf.demfgen.lib.*; import edu.neu.ccs.demeterf.*; public class Start{ public final List sample; public Start(List sample){ this.sample = sample; } public boolean equals(Object o){ if(!(o instanceof Start))return false; Start oo = (Start)o; return (((Object)sample).equals(oo.sample)); } public static Start parse(String inpt) throws ParseException{ return new TheParser(new java.io.StringReader(inpt)).parse_Start(); } public static Start parse(java.io.InputStream inpt) throws ParseException{ return new TheParser(inpt).parse_Start(); } public static Start parse(java.io.Reader inpt) throws ParseException{ return new TheParser(inpt).parse_Start(); } public static class sample extends edu.neu.ccs.demeterf.control.Fields.any{} public int bottomUp() { return new Traversal(new ID() { // add structure details gradually int combine(Apple a){return 4;} // int combine(Pencil p){return 10;} int combine(Item p){return 10;} // bottomUp jumps from 20 to 73 int combine(Empty e){return 0;} int combine(Cons o, int n1, int n2){return n1+n2;} // int combine(Object o, int n1){return n1;} int combine(Start o, int n1){return n1;} int combine(Basket o, int n1){return n1;} // interplay between structure-shyness and safety int combine(Fruit a){return 5;} }). traverse(this); } // magically replace apples by oranges and vice versa // and keep the rest of the structure the same public Start magic() { return new Traversal(new Bc(){ Orange combine(Apple a){return new Orange();} Apple combine(Orange o){return new Apple();} }). traverse(this); } public String display(){ return gen.Display.DisplayM(this); } public String print(){ return gen.Print.PrintM(this); } public String toStr(){ return gen.ToStr.ToStrM(this); } }