package euler;

import euler.problems.Problem1;
import euler.problems.Problem2;
import euler.problems.Problem3;
import euler.problems.Problem4;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @author james.bogan
 */
public class ProjectEuler {
    public static void main(String[] args) throws Exception {
        ExecutorService executor = Executors.newFixedThreadPool(1);
        System.out.println("RESULT: " + executor.submit(new Problem4()).get());
        executor.shutdown();
    }
}

@@ -42,18 +42,19 @@
 blem
-1;
+4;%0A
 %0Aimport 
 eule
@@ -53,97 +53,38 @@
 ort 
-euler.problems.Problem2;%0Aimport euler.problems.Problem3;%0Aimport euler.problems.Problem4;%0A
+java.util.concurrent.Callable;
 %0Aimp
@@ -212,296 +212,1451 @@
 %0A * 
-@author james.bogan%0A */%0Apublic class ProjectEuler %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        ExecutorService executor = Executors.newFixedThreadPool(1);%0A        System.out.println(%22RESULT: %22 + executor.submit(new Problem4()).get());%0A        executor.shutdown(
+Class for executing euler.problems.Problem## classes that return long results.%0A *%0A * Usage:%0A *%0A *      java euler.ProjectEuler problem-number%0A *%0A * where problem-number is a valid project euler problem number (e.g. 4)%0A *%0A * @author james.bogan%0A */%0Apublic class ProjectEuler %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        int problemNumber;%0A        if (args.length == 1) %7B%0A            ExecutorService executor = null;%0A            try %7B%0A                executor = Executors.newSingleThreadExecutor();%0A                problemNumber = Integer.valueOf(args%5B0%5D);%0A%0A                // instantiate the problem's object%0A                Class%3C?%3E problemClass = Class.forName(%22euler.problems.Problem%22 + problemNumber);%0A                Callable%3CLong%3E problemObject = (Callable%3CLong%3E) problemClass.newInstance();%0A%0A                // submit the job and wait for the result%0A                Future%3CLong%3E problemFuture = executor.submit(problemObject);%0A                System.out.println(%22RESULT: %22 + problemFuture.get());%0A%0A                executor.shutdown();%0A            %7D catch (NumberFormatException e) %7B%0A                printUsage();%0A            %7D finally %7B%0A                if (executor != null) %7B%0A                    executor.shutdown();%0A                %7D%0A            %7D%0A        %7D else %7B%0A            printUsage();%0A        %7D%0A    %7D%0A%0A    private static void printUsage() %7B%0A        System.err.println(%22Usage: java euler.ProjectEuler #%22
 );%0A 

Set it up so the ProjectEuler class's main method can be used to find and kick off a problem's solution class