org.progeeks.graph
Class DefaultEdgeDefinition

java.lang.Object
  extended by org.progeeks.graph.DefaultEdgeDefinition
All Implemented Interfaces:
org.apache.commons.collections.Predicate, EdgeDefinition
Direct Known Subclasses:
SimpleEdgeDefinition

public class DefaultEdgeDefinition
extends java.lang.Object
implements EdgeDefinition

Default implementation of EdgeDefintion that can take a filter and user object on the constructor.

Version:
$Revision: 1.4 $
Author:
Paul Speed

Constructor Summary
DefaultEdgeDefinition(org.apache.commons.collections.Predicate filter, java.lang.Object userObject, boolean directed)
           
 
Method Summary
 boolean evaluate(java.lang.Object obj)
          Evaluates an edge to see if it matches this edge definition.
 java.lang.Object getEdgeUserObject(java.lang.Object tail, java.lang.Object head)
          Capable of creating user objects appropriate for edges of the type associated with this edge defition.
 org.apache.commons.collections.Predicate getTraverserPredicate()
          Returns a filter capable of filtering edges of the type associated with this edge definition.
 boolean isDirected()
          Returns true if the edges are directed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEdgeDefinition

public DefaultEdgeDefinition(org.apache.commons.collections.Predicate filter,
                             java.lang.Object userObject,
                             boolean directed)
Method Detail

getTraverserPredicate

public org.apache.commons.collections.Predicate getTraverserPredicate()
Returns a filter capable of filtering edges of the type associated with this edge definition.

Specified by:
getTraverserPredicate in interface EdgeDefinition

isDirected

public boolean isDirected()
Returns true if the edges are directed.

Specified by:
isDirected in interface EdgeDefinition

getEdgeUserObject

public java.lang.Object getEdgeUserObject(java.lang.Object tail,
                                          java.lang.Object head)
Capable of creating user objects appropriate for edges of the type associated with this edge defition.

Specified by:
getEdgeUserObject in interface EdgeDefinition

evaluate

public boolean evaluate(java.lang.Object obj)
Evaluates an edge to see if it matches this edge definition. Default implementation performs a simple user object test.

Specified by:
evaluate in interface org.apache.commons.collections.Predicate
Specified by:
evaluate in interface EdgeDefinition


Copyright © 2002-2003 Paul Speed. All Rights Reserved.