List of usage examples for org.apache.commons.collections.functors TruePredicate INSTANCE
Predicate INSTANCE
To view the source code for org.apache.commons.collections.functors TruePredicate INSTANCE.
Click Source Link
From source file:com.sworddance.util.PredicatedTransformingIterator.java
private void initIfNeeded() { if (baseIterator == null) { FilterIterator filtering = new FilterIterator(iterator); filtering.setPredicate(predicate == null ? TruePredicate.INSTANCE : predicate); baseIterator = new TransformIterator(filtering); baseIterator.setTransformer(transformer == null ? NOPTransformer.INSTANCE : transformer); }/*from w w w .j av a 2s. c o m*/ }
From source file:com.projity.functor.ClosureVisitor.java
/** * */ public ClosureVisitor(Closure visitor) { this(visitor, TruePredicate.INSTANCE); //use TruePredicate for null object pattern }
From source file:com.projity.pm.assignment.HasAssignmentsImpl.java
public static Closure forAllAssignments(Closure visitor) { return forAllAssignments(visitor, TruePredicate.INSTANCE); }
From source file:com.projity.pm.task.Task.java
public static Closure forAllChildren(Closure visitor) { return forAllChildren(visitor, TruePredicate.INSTANCE); }
From source file:org.apache.cayenne.ashwood.graph.FilterIteration.java
public ArcIterator<E, V> outgoingIterator(E vertex) { if (!acceptVertex.evaluate(vertex)) return EmptyIterator.instance(); return new FilterArcIterator<E, V>(digraph.outgoingIterator(vertex), TruePredicate.INSTANCE, acceptVertex, acceptArc);/* www. java 2 s . c o m*/ }
From source file:org.apache.cayenne.ashwood.graph.FilterIteration.java
public ArcIterator<E, V> incomingIterator(E vertex) { if (!acceptVertex.evaluate(vertex)) return EmptyIterator.instance(); return new FilterArcIterator<E, V>(digraph.incomingIterator(vertex), acceptVertex, TruePredicate.INSTANCE, acceptArc);// ww w. j a v a 2 s .c o m }
From source file:org.apache.cayenne.ashwood.graph.StrongConnection.java
public StrongConnection(DigraphIteration<E, V> digraph) { this.dfsStack = new ArrayStack(); this.reverseDFSFilter = new DFSSeenVerticesPredicate(); this.digraph = digraph; this.filteredDigraph = new FilterIteration<>(digraph, new NotSeenPredicate(), TruePredicate.INSTANCE); this.reverseDigraph = new FilterIteration<>(new ReversedIteration<>(digraph), reverseDFSFilter, TruePredicate.INSTANCE);/*from w w w. ja v a2 s . c o m*/ this.vertexIterator = filteredDigraph.vertexIterator(); runDirectDFS(); }
From source file:org.pentaho.di.core.util.KeyValueSet.java
/** * Walk entries./*from ww w. j a va 2 s . c o m*/ * * @param handler * handler to call. * @throws IllegalArgumentException * if handler is null. */ public void walk(final Closure handler) throws IllegalArgumentException { this.walk(handler, TruePredicate.INSTANCE); }
From source file:org.robotframework.javalib.keyword.KeywordMap.java
public KeywordMap() { map = new HashedMap(); map = PredicatedMap.decorate(map, UniquePredicate.getInstance(), TruePredicate.INSTANCE); map = PredicatedMap.decorate(map, NotNullPredicate.INSTANCE, NotNullPredicate.INSTANCE); }
From source file:test.edu.uci.ics.jung.graph.impl.KPartiteTest.java
public void testNonMutex() { a_pred = TruePredicate.INSTANCE; b_pred = TruePredicate.INSTANCE;//from www .jav a 2s. c om partitions = new LinkedList(); partitions.add(a_pred); partitions.add(b_pred); g = new KPartiteSparseGraph(partitions, true); try { g.addVertex(new SparseVertex()); fail("Mutex not enforced!"); } catch (IllegalArgumentException iae) { } }