日期:2014-05-19 浏览次数:20681 次
public static void main(String[] args) { Map<String, ArrayList<Data>> map = new HashMap<String, ArrayList<Data>>(); } public class Data { public String A; public String B; public String C; public Data() { } public String getKey() { return A + " " + B; } @Override public boolean equals(Object o) { if (!(o instanceof Data)) { return false; } Data com = (Data)o; return (com.getKey().equals(this.getKey()) && (com.C.equals(this.C))); } }