@@ -0,0 +1,1327 @@
+package graph;%0A%0A/**%0A * Created by Pawe%C5%82 Kope%C4%87 on 26.12.16.%0A *%0A * Class for automation of Graph subclasses constructing%0A */%0Apublic class GraphFactory %7B%0A%0A    public static Graph getInstance(String className, int verticesNumber, int edgesNumber) throws ClassNotFoundException, IllegalArgumentException %7B%0A        Class graphClass = Class.forName(className);%0A%0A        if (Graph.class.isAssignableFrom(graphClass)) %7B%0A            switch (graphClass.getName()) %7B%0A                case %22graph.ListGraph%22:%0A                    return new ListGraph(verticesNumber);%0A                case %22graph.MatrixGraph%22:%0A                    return new MatrixGraph(verticesNumber, edgesNumber);%0A                default:%0A                    throw new IllegalArgumentException(className + %22 cannot be initialized as Graph.%22);%0A%0A            %7D%0A        %7D else %7B%0A            throw new IllegalArgumentException(className + %22 cannot be initialized as Graph.%22);%0A        %7D%0A    %7D%0A%0A    public static Graph getInstance(String className, int verticesNumber) throws ClassNotFoundException, IllegalArgumentException %7B%0A        return GraphFactory.getInstance(className, verticesNumber, 0);%0A    %7D%0A%0A    public static Graph getInstance(String className) throws ClassNotFoundException, IllegalArgumentException %7B%0A        return GraphFactory.getInstance(className, 0);%0A    %7D%0A%7D%0A

Create GraphFactory.