Generated TextLogik, renamed SystemInput to TextInput
This commit is contained in:
		
							parent
							
								
									812ec1d388
								
							
						
					
					
						commit
						ae881bd8ac
					
				| 
						 | 
					@ -1,21 +0,0 @@
 | 
				
			||||||
import java.util.Scanner;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class SystemInput {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private Scanner scanner;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public SystemInput() {
 | 
					 | 
				
			||||||
        scanner = new Scanner("");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Method: CheckForInput
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public String[] checkForInput() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return new String[] {
 | 
					 | 
				
			||||||
                "Test"
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,31 +1,8 @@
 | 
				
			||||||
public class TextEditor {
 | 
					public class TextEditor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private SystemInput sysInput;
 | 
					 | 
				
			||||||
    private Text text;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void main(String[] args) {
 | 
					    public static void main(String[] args) {
 | 
				
			||||||
        TextEditor t = new TextEditor();
 | 
					        TextLogik tl = new TextLogik();
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public TextEditor() {
 | 
					 | 
				
			||||||
        sysInput = new SystemInput();
 | 
					 | 
				
			||||||
        text = new Text();
 | 
					 | 
				
			||||||
        String command[];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        do {
 | 
					 | 
				
			||||||
            command = sysInput.checkForInput();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            switch (command[0]) {
 | 
					 | 
				
			||||||
                case "ADD":
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                case "REMOVE":
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                default:
 | 
					 | 
				
			||||||
                    System.out.println("Command not found. Try again");
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        } while ("exit".equals(command[0]));
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					import java.util.Scanner;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class TextInput {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private static Scanner sc = new Scanner("");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static String[] checkForInput() {
 | 
				
			||||||
 | 
					        return sc.nextLine().split("");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,24 @@
 | 
				
			||||||
 | 
					public class TextLogik {
 | 
				
			||||||
 | 
					    private Text text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public TextLogik() {
 | 
				
			||||||
 | 
					        text = new Text();
 | 
				
			||||||
 | 
					        String command[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        do {
 | 
				
			||||||
 | 
					            command = TextInput.checkForInput();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            switch (command[0]) {
 | 
				
			||||||
 | 
					                case "ADD":
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case "REMOVE":
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                default:
 | 
				
			||||||
 | 
					                    System.out.println("Command not found. Try again");
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        } while ("exit".equals(command[0]));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue