HashMap lham = new HashMap();
lham.put("key1",value1);
lham.put("key2",value2);
lham.put("key3",value3);value1 = lham.get("key1");
value2 = lham.get("key2");
value3 = lham.get("key3");

解决方案 »

  1.   

    我给你一个我写的class吧,
    class Queue implements Serializable{
    Vector hereVector;
    public Queue() {
    hereVector= new Vector();
    }
    public synchronized void enq(Object x) {
    hereVector.add(x);
    }
    public synchronized Object deq(int i,boolean bool) {
    if( empty() )
    {return null;}
    Object x = hereVector.elementAt(i);
    if(bool)
    {
       hereVector.removeElementAt(i);
    }
    return x;
    }
    public synchronized Object front() {
    if( empty() )
    {return null;}
    return hereVector.elementAt(0);
    }
    public boolean empty() {
    return hereVector.isEmpty();
    }
    public synchronized void clear() {
    hereVector.removeAllElements();
    }
    public int search(Object x) {
    return hereVector.indexOf(x);
    }
    public synchronized int GetLength() {
    return hereVector.size();
    }
    }for(int i=Queue .GetLength();i>0;i--)
    {  // 取name,放入list,或取出匹配值
     
    }