本文整理汇总了Java中org.apache.commons.collections.IteratorUtils.filteredIterator方法的典型用法代码示例。如果您正苦于以下问题:Java IteratorUtils.filteredIterator方法的具体用法?Java IteratorUtils.filteredIterator怎么用?Java IteratorUtils.filteredIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.collections.IteratorUtils
的用法示例。
在下文中一共展示了IteratorUtils.filteredIterator方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeQuery
import org.apache.commons.collections.IteratorUtils; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected List<?> executeQuery(final ActionContext context) {
final MembersReportHandler reportHandler = getReportHandler();
final Pair<MembersTransactionsReportDTO, Iterator<MemberTransactionSummaryReportData>> pair = reportHandler.handleTransactionsSummary(context);
final MembersTransactionsReportDTO dto = pair.getFirst();
final Iterator<MemberTransactionSummaryReportData> reportIterator = pair.getSecond();
final Iterator iterator = IteratorUtils.filteredIterator(reportIterator, new Predicate() {
@Override
public boolean evaluate(final Object element) {
final MemberTransactionSummaryReportData data = (MemberTransactionSummaryReportData) element;
if (dto.isIncludeNoTraders()) {
return true;
}
return data.isHasData();
}
});
return new IteratorListImpl(iterator);
}
示例2: executeQuery
import org.apache.commons.collections.IteratorUtils; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected List<?> executeQuery(final ActionContext context) {
final MembersReportHandler reportHandler = getReportHandler();
final Pair<MembersTransactionsReportDTO, Iterator<MemberTransactionDetailsReportData>> pair = reportHandler.handleTransactionsDetails(context);
final MembersTransactionsReportDTO dto = pair.getFirst();
final Iterator<MemberTransactionDetailsReportData> reportIterator = pair.getSecond();
final Iterator iterator = IteratorUtils.filteredIterator(reportIterator, new Predicate() {
@Override
public boolean evaluate(final Object element) {
final MemberTransactionDetailsReportData data = (MemberTransactionDetailsReportData) element;
if (dto.isIncludeNoTraders()) {
return true;
}
return data.getAmount() != null;
}
});
return new IteratorListImpl(iterator);
}
示例3: getLocalFunctions
import org.apache.commons.collections.IteratorUtils; //导入方法依赖的package包/类
public Iterator getLocalFunctions() {
return localFunctions == null
? IteratorUtils.EMPTY_ITERATOR
: IteratorUtils.filteredIterator(localFunctions.iterator(),
new Predicate() {
public boolean evaluate(Object ob) {
JsUserDefinedMethod method = (JsUserDefinedMethod) ob;
return method.definedAsVar && !method.definedInVar;
}
});
}
示例4: getProperties
import org.apache.commons.collections.IteratorUtils; //导入方法依赖的package包/类
public Iterator getProperties() {
return members == null
? IteratorUtils.EMPTY_ITERATOR
: IteratorUtils.filteredIterator(members.values().iterator(),
new Predicate() {
public boolean evaluate(Object obj) {
return obj instanceof Property;
}
});
}
示例5: getMethods
import org.apache.commons.collections.IteratorUtils; //导入方法依赖的package包/类
public Iterator getMethods() {
return members == null
? IteratorUtils.EMPTY_ITERATOR
: IteratorUtils.filteredIterator(members.values().iterator(),
new Predicate() {
public boolean evaluate(Object obj) {
return obj instanceof Method;
}
});
}