com.phoenixst.plexus

Class TraverserPredicateFactory

public class TraverserPredicateFactory extends Object

A factory for creating TraverserPredicates.

Since: 1.0

Version: $Revision: 1.12 $

Author: Ray A. Conner

Method Summary
static TraverserPredicatecreate(Graph.Edge edge, boolean fromTail)
Creates a new TraverserPredicate which tests for Graph.Edges which look just like the specified edge, ignoring one endpoint.
static TraverserPredicatecreateEquals(Object userObject, Object node, int directionFlags)
Creates a new TraverserPredicate which tests for traversals over Graph.Edges that contain the specified user object, to the specified node, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.
static TraverserPredicatecreateEqualsNode(Object node, int directionFlags)
Creates a new TraverserPredicate which tests for traversals to the specified node, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.
static TraverserPredicatecreateEqualsUser(Object userObject, int directionFlags)
Creates a new TraverserPredicate which tests for traversals over Graph.Edges that contain the specified user object, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.
static TraverserPredicatecreatePredicated(Predicate userObjectPredicate, Predicate nodePredicate, int directionFlags)
Creates a new TraverserPredicate which tests for traversals over Graph.Edges whose contained user object satisfies userObjectPredicate, to a node which satisfies nodePredicate, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.

Method Detail

create

public static final TraverserPredicate create(Graph.Edge edge, boolean fromTail)
Creates a new TraverserPredicate which tests for Graph.Edges which look just like the specified edge, ignoring one endpoint.

If fromTail is true, then the returned Predicate tests for traversals over Graph.Edges that contain the same user object, to the head of the specified edge, with the same directedness. In other words, test as if traversing from the tail looking for a similar Graph.Edge, although the tail itself is not checked.

If fromTail is false, then the returned Predicate tests for traversals over Graph.Edges that contain the same user object, to the tail of the specified edge, with the same directedness. In other words, test as if traversing from the head looking for a similar Graph.Edge, although the head itself is not checked.

createEquals

public static final TraverserPredicate createEquals(Object userObject, Object node, int directionFlags)
Creates a new TraverserPredicate which tests for traversals over Graph.Edges that contain the specified user object, to the specified node, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.

createEqualsNode

public static final TraverserPredicate createEqualsNode(Object node, int directionFlags)
Creates a new TraverserPredicate which tests for traversals to the specified node, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.

createEqualsUser

public static final TraverserPredicate createEqualsUser(Object userObject, int directionFlags)
Creates a new TraverserPredicate which tests for traversals over Graph.Edges that contain the specified user object, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.

createPredicated

public static final TraverserPredicate createPredicated(Predicate userObjectPredicate, Predicate nodePredicate, int directionFlags)
Creates a new TraverserPredicate which tests for traversals over Graph.Edges whose contained user object satisfies userObjectPredicate, to a node which satisfies nodePredicate, with a direction specified relative to the endpoint from which the Graph.Edge is being traversed.
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.