MCPcopy Index your code
hub / github.com/arduino/Arduino / getNextCommand

Method getNextCommand

app/src/processing/app/CommandHistory.java:80–95  ·  view source on GitHub ↗

Gets the next (more recent) command from the history. @return The next command or null if no next command is available.

()

Source from the content-addressed store, hash-verified

78 * @return The next command or {@code null} if no next command is available.
79 */
80 public String getNextCommand() {
81
82 // Return null if there is no next command available.
83 if (!this.hasNextCommand()) {
84 return null;
85 }
86
87 // Get next command.
88 String next = this.iterator.next();
89
90 // Reset 'current' command when at the end of the list.
91 if (this.iterator.nextIndex() == this.commandHistory.size()) {
92 this.iterator.set(""); // Reset 'current' command.
93 }
94 return next;
95 }
96
97 /**
98 * Gets whether a previous (older) command is available in the history.

Callers 1

keyPressedMethod · 0.80

Calls 4

hasNextCommandMethod · 0.95
nextMethod · 0.80
sizeMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected