// ** This class was generated with DemFGen (vers:11/03/2008) package gen; import edu.neu.ccs.demeterf.demfgen.lib.*; import edu.neu.ccs.demeterf.*; public class RawMaterial{ public final List constraints; public final Option> pred; public final Option> nested; public final Option not; public final Option number; public RawMaterial(List constraints, Option> pred, Option> nested, Option not, Option number){ this.constraints = constraints; this.pred = pred; this.nested = nested; this.not = not; this.number = number; } public boolean equals(Object o){ if(!(o instanceof RawMaterial))return false; RawMaterial oo = (RawMaterial)o; return (((Object)constraints).equals(oo.constraints))&&(((Object)pred).equals(oo.pred))&&(((Object)nested).equals(oo.nested))&&(((Object)not).equals(oo.not))&&(((Object)number).equals(oo.number)); } public static RawMaterial parse(String inpt) throws ParseException{ return new TheParser(new java.io.StringReader(inpt)).parse_RawMaterial(); } public static RawMaterial parse(java.io.InputStream inpt) throws ParseException{ return new TheParser(inpt).parse_RawMaterial(); } public static RawMaterial parse(java.io.Reader inpt) throws ParseException{ return new TheParser(inpt).parse_RawMaterial(); } public static class constraints extends edu.neu.ccs.demeterf.control.Fields.any{} public static class pred extends edu.neu.ccs.demeterf.control.Fields.any{} public static class nested extends edu.neu.ccs.demeterf.control.Fields.any{} public static class not extends edu.neu.ccs.demeterf.control.Fields.any{} public static class number extends edu.neu.ccs.demeterf.control.Fields.any{} static class RelationNrComp implements java.util.Comparator{ public int compare(RelationNr a, RelationNr b){ // return a.v.compareTo(b.v); return new Integer(a.v).compareTo(b.v); } } public Map countRelationNrs(){ Map in = TUCombiner.traverse(this,new TUCombiner>(){ Map empty = Map.create(new RelationNrComp()); public Map combine(){ return empty; } public Map fold(Map a, Map b){ return a.merge(b, new Map.Merge(){ public Weight merge(Weight i, Weight j) { return i.sum(j); } }); } Map combine(Constraint c, Weight w, RelationNr r){ return empty.put(r,w); } }, Control.bypass(Constraint.class)); return in; } public Option> get_nested(){ return nested;} public String display(){ return gen.Display.DisplayM(this); } public String print(){ return gen.Print.PrintM(this); } public String toStr(){ return gen.ToStr.ToStrM(this); } }