/** * ChaoticFunctionGenerator creates ChaoticFunctions. * * @author Ben Garrison bdg@cc.gatech.edu * @version 1.0 */ public class ChaoticFunctionGenerator { /** * Creates an object that implements ChaoticFunction, and returns it. * * @param num the number corresponding to the ChaoticFunction to generate. * @return an object that implements ChaoticFunction. */ public static ChaoticFunction getFunction(int num) { if(num == 1) { return new MandlebrotSet(); } else if(num == 2) { return new JuliaSet(-.7269,.1889); } else if(num == 3) { return new JuliaSet(-.391,-.587); } else { throw new RuntimeException("The only valid numbers you can pass into"+ " getFunction are 1,2, or 3."); } } }