Created by hug.
| 4 | * Created by hug. |
| 5 | */ |
| 6 | public class StringInputDevice implements InputSource { |
| 7 | private String input; |
| 8 | private int index; |
| 9 | |
| 10 | public StringInputDevice(String s) { |
| 11 | index = 0; |
| 12 | input = s; |
| 13 | } |
| 14 | |
| 15 | public char getNextKey() { |
| 16 | char returnChar = input.charAt(index); |
| 17 | index += 1; |
| 18 | return returnChar; |
| 19 | } |
| 20 | |
| 21 | public boolean possibleNextInput() { |
| 22 | return index < input.length(); |
| 23 | } |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected