package com.sino.publicclass.base;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

public class Memory extends HashMap {

  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

/**
	 * 
	 */


public Memory() {
    super();
  }

  public String getString(String key) {
    if (get(key) == null) {
      return "";
    } else {
      return (String) get(key);
    }
  }

  public int getInt(String key) {
    if (getString(key).equals("")) {
      return -1;
    } else {
      return Integer.parseInt(getString(key));
    }
  }

  public Object getObject(String key) {
    if (get(key) == null) {
      return null;
    } else {
      return get(key);
    }
  }

  public List getList(String key) {
    return (List) getObject(key);
  }

  public void print(){
	  Iterator iter=this.keySet().iterator();
	  while(iter.hasNext()){
		  String name=(String)iter.next();
		  System.out.println(name+"="+this.get(iter.next()));
	  }
  }
}
