documents reformatted
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user