+++ /dev/null
-public class QueryList extends Queue {
- Queue queries;
-
- public QueryList() {
- queries = global new Queue();
- }
-
- public boolean checkQuery(GlobalString x) {
- boolean set = false;;
- for (int i = 0 ; i < size; i++) {
- if (x.equals((GlobalString)elements[i])) {
- set = true;
- break;
- }
- }
- return set;
- }
-
- public void addQuery(GlobalString x) {
- queries.push(x);
- }
-}
+++ /dev/null
-public class QueryQueue {
- HashSet queries;
- int size;
-
- public QueryQueue() {
- queries = new HashSet();
- size = 0;
- }
-
- public LocalQuery pop() {
- if (queries.isEmpty())
- return null;
- LocalQuery q = (LocalQuery) queries.iterator().next();
- queries.remove(q);
- size--;
- return q;
- }
-
- public void push(LocalQuery x) {
- queries.add(x);
- size++;
- }
-
- public int size() {
- return size;
- }
-
- public boolean isEmpty() {
- if (size == 0)
- return true;
- else
- return false;
- }
-}