|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.uci.ics.jung.utils.PredicateUtils
Convenience methods for handling Predicates in JUNG (as constraints,
as subset specifications, and in general). Not a replacement
for the Jakarta Commons-Collections PredicateUtils class.
| Constructor Summary | |
PredicateUtils()
|
|
| Method Summary | |
static boolean |
addEdgeSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Creates an edge subset for g based on p, which will
be maintained by the g's SubsetManager. |
static boolean |
addVertexSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Creates a vertex subset for g based on p, which will
be maintained by the g's SubsetManager. |
static boolean |
enforcesDirected(Graph g)
Returns true if g is constrained to only
accept directed edges, and false otherwise. |
static boolean |
enforcesEdgeConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns true if p is an edge
constraint of g, and false otherwise. |
static boolean |
enforcesNotParallel(Graph g)
Returns true if g is constrained to
reject parallel edges. |
static boolean |
enforcesUndirected(Graph g)
Returns true if g is constrained to only
accept undirected edges. |
static boolean |
enforcesVertexConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns true if p is an edge
constraint of g, and false otherwise. |
static java.util.Set |
getEdges(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns a Set consisting of all edges e
in graph g that satisfy predicate p,
that is, those for which p.evaluate(e) returns true. |
static java.util.Set |
getVertices(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns a Set consisting of all vertices v
in graph g that satisfy predicate p,
that is, those for which p.evaluate(v) returns true. |
static void |
removeEdgeSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Removes the edge subset based on p from
g's SubsetManager. |
static void |
removeVertexSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Removes the vertex subset based on p from
g's SubsetManager. |
static boolean |
satisfiesEdgeConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns true if each edge in g
satisfies p, and false otherwise. |
static boolean |
satisfiesPredicate(java.util.Collection c,
org.apache.commons.collections.Predicate p)
Returns true if all elements of c
satisfy p. |
static boolean |
satisfiesVertexConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns true if each vertex in g
satisfies p, and false otherwise. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PredicateUtils()
| Method Detail |
public static java.util.Set getVertices(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Returns a Set consisting of all vertices v
in graph g that satisfy predicate p,
that is, those for which p.evaluate(v) returns true.
If g has a SubsetManager that defines
a cached subset based on p, that subset is returned.
public static java.util.Set getEdges(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
Set consisting of all edges e
in graph g that satisfy predicate p,
that is, those for which p.evaluate(e) returns true.
public static boolean addVertexSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
g based on p, which will
be maintained by the g's SubsetManager.
p - the predicate defining the subset
public static boolean addEdgeSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
g based on p, which will
be maintained by the g's SubsetManager.
p - the predicate defining the subset
public static void removeVertexSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
p from
g's SubsetManager.
p - the predicate defining the subset
public static void removeEdgeSubset(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
p from
g's SubsetManager.
p - the predicate defining the subset
public static boolean enforcesEdgeConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
true if p is an edge
constraint of g, and false otherwise.
public static boolean satisfiesEdgeConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
true if each edge in g
satisfies p, and false otherwise. (Note: this may be
true even if p is not a constraint of g.)
public static boolean enforcesVertexConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
true if p is an edge
constraint of g, and false otherwise.
public static boolean satisfiesVertexConstraint(ArchetypeGraph g,
org.apache.commons.collections.Predicate p)
true if each vertex in g
satisfies p, and false otherwise. (Note: this may be
true even if p is not a constraint of g.)
public static boolean satisfiesPredicate(java.util.Collection c,
org.apache.commons.collections.Predicate p)
true if all elements of c
satisfy p.
public static boolean enforcesDirected(Graph g)
true if g is constrained to only
accept directed edges, and false otherwise.
public static boolean enforcesUndirected(Graph g)
true if g is constrained to only
accept undirected edges.
public static boolean enforcesNotParallel(Graph g)
true if g is constrained to
reject parallel edges.
ParallelEdgePredicate
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||