本文整理汇总了Java中org.apache.commons.collections.functors.TruePredicate类的典型用法代码示例。如果您正苦于以下问题:Java TruePredicate类的具体用法?Java TruePredicate怎么用?Java TruePredicate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TruePredicate类属于org.apache.commons.collections.functors包,在下文中一共展示了TruePredicate类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildBackingCollection
import org.apache.commons.collections.functors.TruePredicate; //导入依赖的package包/类
protected List buildBackingCollection(Collection c, Predicate p, Comparator comp)
{
List new_backing_collection = new ArrayList(c.size());
if (p != null && p != TruePredicate.getInstance())
{
for (Iterator iter = c.iterator(); iter.hasNext(); )
{
Object o = iter.next();
if (p.evaluate(o))
new_backing_collection.add(o);
}
}
if (comp != null)
Collections.sort(new_backing_collection, comp);
return new_backing_collection;
}
示例2: walk
import org.apache.commons.collections.functors.TruePredicate; //导入依赖的package包/类
/**
* Walk entries.
*
* @param handler
* handler to call.
* @throws IllegalArgumentException
* if handler is null.
*/
public void walk(final Closure handler) throws IllegalArgumentException {
this.walk(handler, TruePredicate.INSTANCE);
}
示例3: walk
import org.apache.commons.collections.functors.TruePredicate; //导入依赖的package包/类
/**
* Walk entries.
*
* @param handler
* handler to call.
* @throws IllegalArgumentException
* if handler is null.
*/
public void walk( final Closure handler ) throws IllegalArgumentException {
this.walk( handler, TruePredicate.INSTANCE );
}