나는 ArrayList
그럼 내가 그 속성 백 등으로의 ArrayList를 작성검색 데이터는
class Attribute{
private int id;
public string getID(){
return this.id;
}
private string value;
public string getValue(){
return this.value;
}
//... more properties here...
}
Attributes
를 포함합니다. 그리고 정의 된 ID로 Attribute를 찾고 싶습니다. 나는 이런 식으로하고 싶다.
ArrayList<Attribute> arr = new ArrayList<Attribute>();
fillList(arr); //Method that puts a lot of these Attributes in the list
arr.find(234); //Find the attribute with the ID 234;
유일한 해결책은 ArrayList를 반복하는 것이다.
감사합니다. 네, 해시 맵의 거의 모든 속성을 조회해야합니다. 그리고 아직 모든 코드를 작성하지 않았습니다. 그래서 나는 그것을 많이 바꿔도 괜찮습니다. 나는 단지 배우기를 원합니다. 감사합니다. –