// ** This class was generated with DemFGen (vers:09/12/2009)

package gen;

import java.io.FileInputStream;
import edu.neu.ccs.demeterf.lib.*;




/** Representation of Transaction */
public class Transaction{
    protected final TransactionType ttype;
    protected final Challenge challenge;

    /** Construct a(n) Transaction Instance */
    public Transaction(TransactionType ttype, Challenge challenge){
        this.ttype = ttype;
        this.challenge = challenge;
    }
    /** Is the given object Equal to this Transaction? */
    public boolean equals(Object o){
        if(!(o instanceof Transaction))return false;
        if(o == this)return true;
        Transaction oo = (Transaction)o;
        return (((Object)ttype).equals(oo.ttype))&&(((Object)challenge).equals(oo.challenge));
    }
    /** Parse an instance of Transaction from the given String */
    public static Transaction parse(String inpt) throws ParseException{
        return new TheParser(new java.io.StringReader(inpt)).parse_Transaction();
    }
    /** Parse an instance of Transaction from the given Stream */
    public static Transaction parse(java.io.InputStream inpt) throws ParseException{
        return new TheParser(inpt).parse_Transaction();
    }
    /** Parse an instance of Transaction from the given Reader */
    public static Transaction parse(java.io.Reader inpt) throws ParseException{
        return new TheParser(inpt).parse_Transaction();
    }

    /** Field Class for Transaction.ttype */
    public static class ttype extends edu.neu.ccs.demeterf.control.Fields.any{}
    /** Field Class for Transaction.challenge */
    public static class challenge extends edu.neu.ccs.demeterf.control.Fields.any{}

    /** DGP method from Class ToStr */
    public String toStr(){ return gen.ToStr.ToStrM(this); }
    /** DGP method from Class Print */
    public String print(){ return gen.Print.PrintM(this); }
    /** DGP method from Class Display */
    public String display(){ return gen.Display.DisplayM(this); }

}