documents reformatted

This commit is contained in:
cs-powell
2024-11-25 13:49:01 -05:00
parent cc17797319
commit 88967419c6
12 changed files with 490 additions and 542 deletions

View File

@@ -7,16 +7,15 @@ public class MindQueue {
LinkedList<Action> q;
public MindQueue () {
public MindQueue() {
q = new LinkedList<Action>();
}
public void push(Action e){
public void push(Action e) {
q.add(e);
}
public Action removeEvent(Action e){
public Action removeEvent(Action e) {
Action temp = e;
q.remove(e);
return temp;
@@ -24,36 +23,35 @@ public class MindQueue {
public Action pop() {
Vision v = new Vision();
if(q.isEmpty()) {
if (q.isEmpty()) {
return v;
}
return q.remove();
}
public boolean isEmpty(){
public boolean isEmpty() {
return q.isEmpty();
}
public String printQueue(){
public String printQueue() {
String queueTrace = "Next to Execute ==> ";
for (Action action : q) {
if(action.getType() == ActionType.VISION){
if (action.getType() == ActionType.VISION) {
queueTrace += "[V]";
}
if(action.getType() == ActionType.MOTOR){
}
if (action.getType() == ActionType.MOTOR) {
queueTrace += "[M]";
}
if(action.getType() == ActionType.DELAY){
}
if (action.getType() == ActionType.DELAY) {
queueTrace += "[D]";
}
}
}
return queueTrace;
return queueTrace;
}
public int queueLength(){
public int queueLength() {
return q.size();
}
}