如何从对象内部访问对象:
public List<Tasks> multipleFilter(String PriorityFilter,String startDateFilter,String endDateFilter,List<Tasks> listAllTasks)
{
List<Tasks> listTasksAfterFiltering = new ArrayList<>();
for(Tasks task_obj : listAllTasks)
{
String PriorityTask = task_obj.getPriority();
String startDateTask = task_obj.getStartDate();
String endDateTask = task_obj.getEndDate();
if(PriorityFilter.equals(PriorityTask) || PriorityFilter.isEmpty())
if(startDateFilter.equals(startDateTask) || startDateFilter.isEmpty())
if(endDateFilter.equals(endDateTask) || endDateFilter.isEmpty())
if(!PriorityFilter.isEmpty() || !startDateFilter.isEmpty() || !endDateFilter.isEmpty()){
listTasksAfterFiltering.add(task_obj);
}
}
return listTasksAfterFiltering;
}
答案 0 :(得分:1)
我认为您想要的是let test = Array(marketDailyData.timeSeriesDaily.values)[0]
答案 1 :(得分:1)
错误消息对此进行了解释:TimeSeriesDaily是由String而不是int键入的字典
试试
let test = marketDailyData.timeSeriesDaily["2019-01-28"]