【发布时间】:2016-06-02 00:15:57
【问题描述】:
有没有办法将一个列表拆分为多个列表?根据it元素的特定条件将给定列表分成两个或多个列表。
final List<AnswerRow> answerRows= getAnswerRows(.........);
final AnswerCollection answerCollections = new AnswerCollection();
answerCollections.addAll(answerRows);
The AnswerRow has properties like rowId, collectionId
基于 collectionId 我想创建一个或多个 AnswerCollections
【问题讨论】:
-
是的。你怀疑这是可能的吗?您对这样做有什么具体问题?
-
可以根据list元素属性拆分成多个list吗?
标签: java collections apache-commons