-1
hashmultimap을 만들었습니다 iterator를 사용하여 hashmultimap 내에서 내 Student 개체에 액세스하려면 어떻게해야합니까?Google Guava MultiMap 내 개체에 액세스하는 방법을 모르겠다
Multimap<Integer, Object> myMultimap2 = HashMultimap.create();
Student one = new Student("Bob","Any",35);
Student two = new Student("Tom","Johnson",22);
Student three = new Student("Yo","Zun",42);
myMultimap2.put(1,one);
myMultimap2.put(2,two);
myMultimap2.put(2,three);
Iterator<Integer> iterator = myMultimap2.keySet().iterator();
while (iterator.hasNext()){
int key = iterator.next();
System.out.println(key);
Collection collection = myMultimap2.get(key);
Iterator iterator2 = collection.iterator();
while (iterator2.hasNext()){
System.out.println(iterator2.next());
???????
}
}
그래서이 클래스가 존재한다고 생각했습니다. howto 삽입에 관한 문서를 읽었지만, 값 검색에 관한 문서를 읽을 수 없습니까? 그냥 궁금해서 ... – GhostCat