CS计算机代考程序代写 package byow.InputDemo;

package byow.InputDemo;

/**
* Created by hug.
*/
public class StringInputDevice implements InputSource {
private String input;
private int index;

public StringInputDevice(String s) {
index = 0;
input = s;
}

public char getNextKey() {
char returnChar = input.charAt(index);
index += 1;
return returnChar;
}

public boolean possibleNextInput() {
return index < input.length(); } }