【发布时间】:2017-04-14 03:39:21
【问题描述】:
我正在循环一个列表以从列表数组中获取特定的 id:
这是我正在循环的列表:
for(int i =0 ;i<listOfIds.size();i++) {
System.out.println("list of post_ids " + listOfIds.get(i));
}
循环后的输出是:
list of post_ids Model: com.soul.seeker.models.PostsCategories, table: 'posts_categories', attributes: {post_id=184}
list of post_ids Model: com.soul.seeker.models.PostsCategories, table: 'posts_categories', attributes: {post_id=185}
现在我想访问特定元素,即attributes: {post_id=185}。我该怎么做?
更新:类 List 的类型为 LazyList,来自 http://javalite.github.io/activejdbc/snapshot/
【问题讨论】:
-
列表中的每个元素是什么类?该类有哪些用于检索属性的方法?
-
列表的签名是什么,该对象的结构是什么
-
我询问了列表中元素的类别,而不是列表本身。你还没有回答。这个问题是关于如何从对象本身而不是从列表中提取一些东西。
标签: java activejdbc javalite