// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;

public class QueueManager {
    private HashMap allq = null;
    public QueueManager() {
        allq = new HashMap();
    }
    private Queue getQ(String name) {
        if(allq.containsKey(name)) {
            return (Queue)allq.get(name);
        } else {
            Queue q = new Queue();
            allq.put(name, q);
            return q;
        }
    }
    public void enq(String name, Object o) {
        getQ(name).enq(o);
    }
    public Object deq(String name) {
        return getQ(name).deq();
    }
}
