legacy commit 4 (backlog)
This commit is contained in:
40
Java/Project_Models/Cognitive_Model/MindQueue.java
Normal file
40
Java/Project_Models/Cognitive_Model/MindQueue.java
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class MindQueue {
|
||||
|
||||
LinkedList<Action> q;
|
||||
|
||||
public MindQueue () {
|
||||
q = new LinkedList<Action>();
|
||||
}
|
||||
|
||||
public void push(Action e){
|
||||
q.add(e);
|
||||
}
|
||||
|
||||
|
||||
public Action removeEvent(Action e){
|
||||
Action temp = e;
|
||||
q.remove(e);
|
||||
return temp;
|
||||
}
|
||||
|
||||
public Action pop() {
|
||||
Vision v = new Vision();
|
||||
if(q.isEmpty()) {
|
||||
return v;
|
||||
}
|
||||
return q.remove();
|
||||
}
|
||||
|
||||
public boolean isEmpty(){
|
||||
return q.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user