// ** This file was generated with DemFGen (vers:12/15/2010)

package scg;

import edu.neu.ccs.demeterf.lib.*;
import java.lang.reflect.*;





/** Representation of InstanceSet */
public class InstanceSet{
    protected FullyQualifiedClassName instanceSetClassName;
    protected InstanceSetI instanceSet;
    protected verbatim instanceSetSpec;

    /** Construct a(n) InstanceSet Instance */
    public InstanceSet(FullyQualifiedClassName instanceSetClassName, InstanceSetI instanceSet, verbatim instanceSetSpec){
        this.instanceSetClassName = instanceSetClassName;
        this.instanceSet = instanceSet;
        this.instanceSetSpec = instanceSetSpec;
    }
    /** Is the given object Equal to this InstanceSet? */
    public boolean equals(Object o){
        if(!(o instanceof InstanceSet))return false;
        if(o == this)return true;
        InstanceSet oo = (InstanceSet)o;
        return (((Object)instanceSetClassName).equals(oo.instanceSetClassName))&&(((Object)instanceSet).equals(oo.instanceSet))&&(((Object)instanceSetSpec).equals(oo.instanceSetSpec));
    }
    /** Parse an instance of InstanceSet from the given String */
    public static InstanceSet parse(String inpt) throws scg.ParseException{
        return new scg.TheParser(new java.io.StringReader(inpt)).parse_InstanceSet();
    }
    /** Parse an instance of InstanceSet from the given Stream */
    public static InstanceSet parse(java.io.InputStream inpt) throws scg.ParseException{
        return new scg.TheParser(inpt).parse_InstanceSet();
    }
    /** Parse an instance of InstanceSet from the given Reader */
    public static InstanceSet parse(java.io.Reader inpt) throws scg.ParseException{
        return new scg.TheParser(inpt).parse_InstanceSet();
    }

    /** Field Class for InstanceSet.instanceSetClassName */
    public static class instanceSetClassName extends edu.neu.ccs.demeterf.Fields.any{}
    /** Field Class for InstanceSet.instanceSet */
    public static class instanceSet extends edu.neu.ccs.demeterf.Fields.any{}
    /** Field Class for InstanceSet.instanceSetSpec */
    public static class instanceSetSpec extends edu.neu.ccs.demeterf.Fields.any{}
 
	public void finishParse(){
		try{
			String className = getInstanceSetClassName().print().trim();
			Class<?> pgInstanceSetClass = Class.forName(className);
			Method parseMethod = pgInstanceSetClass.getMethod("parse", String.class);
			InstanceSetI instanceSet = (InstanceSetI) parseMethod.invoke(null, getInstanceSetSpec().getText());
			setInstanceSet(instanceSet);
		} catch(Exception ex){
			ex.printStackTrace();		
		}
		
	}

    /** DGP method from Class Print */
    public String print(){ return scg.Print.PrintM(this); }
    /** Setter for field InstanceSet.instanceSetClassName */
    public void setInstanceSetClassName(FullyQualifiedClassName _instanceSetClassName){ instanceSetClassName = _instanceSetClassName; }
    /** Setter for field InstanceSet.instanceSet */
    public void setInstanceSet(InstanceSetI _instanceSet){ instanceSet = _instanceSet; }
    /** Setter for field InstanceSet.instanceSetSpec */
    public void setInstanceSetSpec(verbatim _instanceSetSpec){ instanceSetSpec = _instanceSetSpec; }
    /** Getter for field InstanceSet.instanceSetClassName */
    public FullyQualifiedClassName getInstanceSetClassName(){ return instanceSetClassName; }
    /** Getter for field InstanceSet.instanceSet */
    public InstanceSetI getInstanceSet(){ return instanceSet; }
    /** Getter for field InstanceSet.instanceSetSpec */
    public verbatim getInstanceSetSpec(){ return instanceSetSpec; }

}


