当前位置: 首页>>代码示例>>Java>>正文


Java Predicate.evaluate方法代码示例

本文整理汇总了Java中org.apache.commons.collections15.Predicate.evaluate方法的典型用法代码示例。如果您正苦于以下问题:Java Predicate.evaluate方法的具体用法?Java Predicate.evaluate怎么用?Java Predicate.evaluate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.collections15.Predicate的用法示例。


在下文中一共展示了Predicate.evaluate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitTraitInstancesForTrial

import org.apache.commons.collections15.Predicate; //导入方法依赖的package包/类
@Override
public void visitTraitInstancesForTrial(int trialId, boolean withTraits,
        Predicate<TraitInstance> traitInstanceVisitor)
throws IOException {
	WithTraitOption withTraitOption = withTraits
			? WithTraitOption.ALL_WITH_TRAITS
			: WithTraitOption.ALL_WITHOUT_TRAITS;
	Predicate<TraitInstance> visitor = new Predicate<TraitInstance>() {
           @Override
           public boolean evaluate(TraitInstance ti) {
               Boolean result = Boolean.TRUE;
               if (traitIds.contains(ti.getTraitId())) {
                   result = traitInstanceVisitor.evaluate(ti);
               }
               return result;
           }
       };
       kdsmartDatabase.visitTraitInstancesForTrial(trialId,
			withTraitOption,
			visitor);
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:22,代码来源:MyTrialExportHelper.java

示例2: getEditStateSamplesByPlot

import org.apache.commons.collections15.Predicate; //导入方法依赖的package包/类
public Map<Plot,Map<Integer,KdxSample>> getEditStateSamplesByPlot(TraitInstance ti, Predicate<Plot> plotFilter) {

        Map<Plot,Map<Integer,KdxSample>> result = new HashMap<>(plots.size());
        for (Plot plot : plots) {
            if (plotFilter == null || plotFilter.evaluate(plot)) {
                for (Integer psnum : plot.getSpecimenNumbers(PlotOrSpecimen.INCLUDE_PLOT)) {
                    PlotOrSpecimen pos = plot.getPlotOrSpecimen(psnum);
                    KdxSample sm = getEditStateSampleFor(ti, pos);

                    if (sm != null) {
                        Map<Integer, KdxSample> map = result.get(plot);
                        if (map == null) {
                            map = new HashMap<>();
                            result.put(plot, map);
                        }
                        map.put(psnum, sm);
                    }
                }
            }
        }
        return result;
    }
 
开发者ID:kddart,项目名称:kdxplore,代码行数:23,代码来源:CurationData.java

示例3: convertToBDD

import org.apache.commons.collections15.Predicate; //导入方法依赖的package包/类
/**
 * Returns a {@link BDD} representing the given {@link Term} while respecting the exists-variables.
 * 
 * @param term
 *            the term
 * @param existsPredicate
 *            the exists predicate
 * @return a bdd representing the given term
 */
public BDD<T> convertToBDD(Term term, Predicate<T> existsPredicate) {
	BDD<T> bdd = transform(term);
	if (!(existsPredicate == null)) {
		Set<T> variables = Terms.getVariables(term);
		for (T variable : variables) {
			if (existsPredicate.evaluate(variable)) {
				BDD<T> tmp = bdd.exist(variable);
				bdd.free();
				bdd = tmp;
			}
		}
	}
	return bdd;
}
 
开发者ID:felixreimann,项目名称:jreliability,代码行数:24,代码来源:BDDTTRF.java

示例4: getEditStateSamplesByPlotOrSpecimen

import org.apache.commons.collections15.Predicate; //导入方法依赖的package包/类
public Map<PlotOrSpecimen,KdxSample> getEditStateSamplesByPlotOrSpecimen(TraitInstance ti, Predicate<Plot> plotFilter) {
	Map<PlotOrSpecimen,KdxSample> result = new HashMap<>(plots.size());
	for (Plot plot : plots) {
		if (plotFilter == null || plotFilter.evaluate(plot)) {
		    for (Integer psnum : plot.getSpecimenNumbers(PlotOrSpecimen.INCLUDE_PLOT)) {
                PlotOrSpecimen pos = plot.getPlotOrSpecimen(psnum);
                KdxSample sm = getEditStateSampleFor(ti, pos);
                if (sm != null) {
                    result.put(pos, sm);
                }
		    }
		}
	}
	return result;
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:16,代码来源:CurationData.java

示例5: collectColumnIndices

import org.apache.commons.collections15.Predicate; //导入方法依赖的package包/类
protected List<Integer> collectColumnIndices(Predicate<ValueRetriever<?>> predicate) {
	List<Integer> result = new ArrayList<>();
	for (int vfIndex = valueRetrievers.size(); --vfIndex >= 0; ) {
		ValueRetriever<?> vr = valueRetrievers.get(vfIndex);
		if (predicate.evaluate(vr)) {
			result.add(vfIndex);
		}
	}
	return result;
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:11,代码来源:CurationTableModel.java


注:本文中的org.apache.commons.collections15.Predicate.evaluate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。