0
//使用Offer ID查找特定事件的索引的最佳方式是什麼?
使用核心Java或使用第三方庫(Guava/Commons Collection)?如何使用列表項中的屬性來查找數組列表項的索引?
public class Event{
private String title;
//other attributes
private ArrayList<Offers> lOffers;
}
public class Offers{
private Sring Id;
private String offerName;
}
//Code
List<PayPerViewTitles> PayPerViewTitleList = someMethod();
/*
offerId -> Offers Object id property
**/
private int findEventPositionByOfferId(List<Event> eventList, String offerId){
// how to implement this method to find the Main Event using the
offer->id
}
此對象用於映射服務器JSON響應,
在嘗試尋找最佳方式之前,您是否至少嘗試過**方式?你爲什麼不尊重Java命名約定? –
並且此offerId存在於哪裏? –
'lOffers'應該是一個列表?你有沒有考慮使用其他數據結構? –