01: package com.sun.portal.subscriptions.profiler;
02:
03: import java.util.*;
04:
05: public class UserQueue {
06: private Vector data = new Vector();
07:
08: public UserQueue(Collection c) {
09: try {
10: this .data = new Vector(c);
11: } catch (Exception e) {
12: System.out.println("UserQueue.constructor exception");
13: e.printStackTrace(System.err);
14: }
15: }
16:
17: synchronized public Object get() {
18: Object obj = null;
19: if (data.size() != 0) {
20: obj = data.elementAt(0);
21: data.removeElementAt(0);
22: }
23: return obj;
24: }
25: }
|