- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMiniWPI.java
More file actions
Latest commit
86 lines (55 loc) · 2.23 KB
/
Copy pathMiniWPI.java
File metadata and controls
86 lines (55 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
importjava.util.Stack;
publicinterfaceMiniWPI {
/** Stack of Characters to the left of the cursor; the ones
* near the top of the stack are closest to the cursor.
*/
publicstaticfinalStack<Character> left = newStack<Character>();
/** Stack of Characters to the right of the cursor; the ones
* near the top of the stack are closest to the cursor.
*/
publicstaticfinalStack<Character> right = newStack<Character>();
/** Is cursor at the start of the text? */
publicbooleanisAtStart();
/** Is cursor at the end of the text? */
publicbooleanisAtEnd();
/** Insert c into the string at the cursor. */
publicvoidinsertChar(charc);
/** Move cursor left 1 character. If we're already at the
* start of the string, do nothing.
*/
publicvoidmoveLeft();
/** Move cursor right 1 character. If we're already at the
* end of the string, do nothing.
*/
publicvoidmoveRight();
/** Delete character before the cursor. If there is none,
* do nothing. */
publicvoidbackspace();
/** Delete character after the cursor. If there is none,
* do nothing. */
publicvoiddelete();
/** Move cursor to start of the text. */
publicvoidmoveToStart();
/** Move cursor to end of the text. */
publicvoidmoveToEnd();
/** Convert to string. The cursor position is ignored.
* @see toStringCursor
*/
publicStringtoString();
/** Like toString, but the special character | is included
* to mark the cursor position.
*/
publicStringtoStringCursor();
/** Search forward for the next occurrence of c that starts at the
* cursor or later. If found, leave the cursor immediately after
* that occurrence and return true. Else, leave the cursor at the
* end of the text and return false. */
publicbooleansearch(charc);
/** Method that reads in the string that was retrieved from the top of the Queue and
* executes the appropriate command. It also calls a method to print out the command
* just executed and the resulting stacks
*/
publicvoidprocessCommand(Strings);
/* Method to print out a command and the results */
publicvoidprinttest(Strings);
}