本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}