/// <param name="fileName"> </param> /// <param name="loc"> </param> /// <param name="superClass"> </param> public ClassGenerator(string fileName, int loc, ClassGenerator superClass) : base() { this.fileName = fileName; //Atleast one variable per class. Added in response to Ishtiaque's comment. int maxNoOfVars = ConfigurationXMLParser.getPropertyAsInt("maxNoOfClassFields"); int minNoOfFields = ConfigurationXMLParser.getPropertyAsInt("minNoOfClassFields"); // to avoid Illegal argument exception if (maxNoOfVars != 0) { this.numOfVars = (new Random()).Next(maxNoOfVars); } else { this.numOfVars = 0; } if (numOfVars < minNoOfFields) { numOfVars = minNoOfFields; } this.numberOfMethods = 0; this.loc = loc; this.percent = ConfigurationXMLParser.getPropertyAsInt("probability"); this.maxNestedIfs = ConfigurationXMLParser.getPropertyAsInt("maxNestedIfs"); this.maxAllowedMethodCalls = ConfigurationXMLParser.getPropertyAsInt("maxAllowedMethodCalls"); this.superClass = superClass; }
private void addSubClass(ClassGenerator classGenerator) { this.subClasses.Add(classGenerator); }