public abstract class SortFactory { protected String algorithm; // the type of sorting algorithm we want to generate public void setFactory(String algorithm) { this.algorithm = algorithm; } // This must generate the appropriate sorting algorithm // according to what was set in setFactory() public abstract SortingAlgorithm getAlgorithm(); }