/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @see org.apache.commons.collections.functors.NotPredicate * * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws IllegalArgumentException if the predicate is null */ public static Predicate notPredicate(Predicate predicate) { return NotPredicate.getInstance(predicate); }
public WalkDepthFirstSearch() { this.edgePredicate = NotPredicate.getInstance( new EdgeDisabledPredicate() ); }
public WalkBreadthFirstSearch() { this.edgePredicate = NotPredicate.getInstance( new EdgeDisabledPredicate() ); }
final public Predicate not(Function fieldFunction) throws ParseException { Predicate predicate = null; jj_consume_token(NOT); predicate = expression(fieldFunction); { if (true) return NotPredicate.getInstance(predicate); } throw new Error("Missing return statement in function"); }
public void finishGraph( DependencyGraph graph ) { super.finishGraph( graph ); if ( MapUtils.isEmpty( this.foundNodesMap ) ) { return; } // Find winning node. ArtifactReference winningArtifact = findWinningArtifact( this.foundNodesMap.values() ); DependencyGraphNode winningNode = graph.getNode( winningArtifact ); // Gather up Losing Nodes. Set<NodeLocation> losingNodes = new HashSet<NodeLocation>(); Predicate losersPredicate = NotPredicate.getInstance( new NodeLocationPredicate( winningArtifact ) ); CollectionUtils.select( this.foundNodesMap.values(), losersPredicate, losingNodes ); // Swing losing nodes to winning node. for ( NodeLocation losingNodeLoc : losingNodes ) { DependencyGraphNode losingNode = graph.getNode( losingNodeLoc.artifact ); DependencyGraphUtils.collapseNodes( graph, losingNode, winningNode ); } }
/** * Clean out any nodes that may have become orphaned in the graph. * * @param graph the graph to check. */ public static void cleanupOrphanedNodes( DependencyGraph graph ) { boolean done = false; Predicate orphanedNodePredicate = new OrphanedNodePredicate( graph ); Predicate notRootNode = NotPredicate.getInstance( new NodePredicate( graph.getRootNode().getArtifact() ) ); Predicate orphanedChildNodePredicate = AndPredicate.getInstance( notRootNode, orphanedNodePredicate ); while ( !done ) { // Find orphaned node. DependencyGraphNode orphanedNode = (DependencyGraphNode) CollectionUtils.find( graph.getNodes(), orphanedChildNodePredicate ); if ( orphanedNode == null ) { done = true; break; } // Remove edges FROM orphaned node. for ( DependencyGraphEdge edge : graph.getEdgesFrom( orphanedNode ) ) { graph.removeEdge( edge ); } // Remove orphaned node. graph.removeNode( orphanedNode ); } }