// ** This file was generated with DemFGen (vers:12/15/2010) package gen; import edu.neu.ccs.demeterf.lib.*; import edu.neu.ccs.demeterf.*; import edu.neu.ccs.demeterf.lib.*; import edu.neu.ccs.demeterf.*; import java.lang.Integer; /** Representation of PG_Claim */ public class PG_Claim implements PG_ClaimInterface{ protected final int n; protected final int k; protected final int q; /** Construct a(n) PG_Claim Instance */ public PG_Claim(int n, int k, int q){ this.n = n; this.k = k; this.q = q; } /** Is the given object Equal to this PG_Claim? */ public boolean equals(Object o){ if(!(o instanceof PG_Claim))return false; if(o == this)return true; PG_Claim oo = (PG_Claim)o; return (((Object)n).equals(oo.n))&&(((Object)k).equals(oo.k))&&(((Object)q).equals(oo.q)); } /** Parse an instance of PG_Claim from the given String */ public static PG_Claim parse(String inpt) throws gen.ParseException{ return new gen.TheParser(new java.io.StringReader(inpt)).parse_PG_Claim(); } /** Parse an instance of PG_Claim from the given Stream */ public static PG_Claim parse(java.io.InputStream inpt) throws gen.ParseException{ return new gen.TheParser(inpt).parse_PG_Claim(); } /** Parse an instance of PG_Claim from the given Reader */ public static PG_Claim parse(java.io.Reader inpt) throws gen.ParseException{ return new gen.TheParser(inpt).parse_PG_Claim(); } /** Field Class for PG_Claim.n */ public static class n extends edu.neu.ccs.demeterf.Fields.any{} /** Field Class for PG_Claim.k */ public static class k extends edu.neu.ccs.demeterf.Fields.any{} /** Field Class for PG_Claim.q */ public static class q extends edu.neu.ccs.demeterf.Fields.any{} public double quality(PG_Claim c) { return c.q / c.n; } /** DGP method from Class Display */ public String display(){ return gen.Display.DisplayM(this); } /** DGP method from Class Print */ public String print(){ return gen.Print.PrintM(this); } /** DGP method from Class ToStr */ public String toStr(){ return gen.ToStr.ToStrM(this); } /** Updater for field PG_Claim.n */ public PG_Claim updateN(int _n){ return new PG_Claim(_n, k, q); } /** Updater for field PG_Claim.k */ public PG_Claim updateK(int _k){ return new PG_Claim(n, _k, q); } /** Updater for field PG_Claim.q */ public PG_Claim updateQ(int _q){ return new PG_Claim(n, k, _q); } /** Getter for field PG_Claim.n */ public int getN(){ return n; } /** Getter for field PG_Claim.k */ public int getK(){ return k; } /** Getter for field PG_Claim.q */ public int getQ(){ return q; } }