本文整理了Java中org.apache.commons.collections4.CollectionUtils.countMatches()
方法的一些代码示例,展示了CollectionUtils.countMatches()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CollectionUtils.countMatches()
方法的具体详情如下:
包路径:org.apache.commons.collections4.CollectionUtils
类名称:CollectionUtils
方法名:countMatches
[英]Counts the number of elements in the input collection that match the predicate.
A null
collection or predicate matches no elements.
[中]统计输入集合中与谓词匹配的元素数。null
集合或谓词不匹配任何元素。
代码示例来源:origin: opencast/opencast
/**
* @see org.opencastproject.serviceregistry.impl.jmx.ServicesStatisticsMXBean#getWarningServiceCount()
*/
@Override
public int getWarningServiceCount() {
return CollectionUtils.countMatches(services.values(), PredicateUtils.equalPredicate(ServiceState.WARNING));
}
代码示例来源:origin: opencast/opencast
/**
* @see org.opencastproject.serviceregistry.impl.jmx.HostsStatisticsMXBean#getOnlineCount()
*/
@Override
public int getOnlineCount() {
return CollectionUtils.countMatches(hosts.values(), PredicateUtils.equalPredicate(ONLINE));
}
代码示例来源:origin: opencast/opencast
/**
* @see org.opencastproject.serviceregistry.impl.jmx.HostsStatisticsMXBean#getOfflineCount()
*/
@Override
public int getOfflineCount() {
return CollectionUtils.countMatches(hosts.values(), PredicateUtils.equalPredicate(OFFLINE));
}
代码示例来源:origin: opencast/opencast
/**
* @see org.opencastproject.serviceregistry.impl.jmx.ServicesStatisticsMXBean#getNormalServiceCount()
*/
@Override
public int getNormalServiceCount() {
return CollectionUtils.countMatches(services.values(), PredicateUtils.equalPredicate(ServiceState.NORMAL));
}
代码示例来源:origin: opencast/opencast
/**
* @see org.opencastproject.serviceregistry.impl.jmx.HostsStatisticsMXBean#getInMaintenanceCount()
*/
@Override
public int getInMaintenanceCount() {
return CollectionUtils.countMatches(hosts.values(), PredicateUtils.equalPredicate(MAINTENANCE));
}
代码示例来源:origin: opencast/opencast
/**
* @see org.opencastproject.serviceregistry.impl.jmx.ServicesStatisticsMXBean#getErrorServiceCount()
*/
@Override
public int getErrorServiceCount() {
return CollectionUtils.countMatches(services.values(), PredicateUtils.equalPredicate(ServiceState.ERROR));
}
代码示例来源:origin: com.github.rvesse/airline
private <T> boolean isApplicableToOption(ParseState<T> state, OptionMetadata option) {
int index = CollectionUtils.countMatches(state.getParsedOptions(), new ParsedOptionFinder(option))
% option.getArity();
return indices.contains(index);
}
代码示例来源:origin: NationalSecurityAgency/datawave
int count = CollectionUtils.countMatches(
queryLogics,
object -> {
内容来源于网络,如有侵权,请联系作者删除!