org.progeeks.graph
Class ObjectFieldPredicate

java.lang.Object
  extended by org.progeeks.graph.ObjectFieldPredicate
All Implemented Interfaces:
java.io.Serializable, org.apache.commons.collections.Predicate

public class ObjectFieldPredicate
extends java.lang.Object
implements org.apache.commons.collections.Predicate, java.io.Serializable

Predicate that evaluates based on objectClass instance, if specified, as well as field=value inspection, also if specified.

Version:
$Revision: 1.7 $
Author:
Dave Garvis
See Also:
Serialized Form

Constructor Summary
ObjectFieldPredicate()
           
ObjectFieldPredicate(java.lang.Class objectClass)
           
ObjectFieldPredicate(java.lang.Class objectClass, java.lang.String field, java.lang.Object value)
           
ObjectFieldPredicate(java.lang.String field, java.lang.Object value)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean evaluate(java.lang.Object node)
          Returns true if the specified node is of type objectClass and/or its value matches that which is define in the value and >code>field members.
 java.lang.String getFieldName()
          Returns the field name for this predicate.
 java.lang.Class getObjectClass()
          Returns the class for this predicate.
 java.lang.Object getValue()
          Returns the value associated with the field of this predicate.
 int hashCode()
           
 void setFieldName(java.lang.String field)
          Sets the field name for this predicate.
 void setObjectClass(java.lang.Class c)
          Sets the class for this predicate.
 void setValue(java.lang.Object value)
          Sets the value associated with the field of this predicate.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectFieldPredicate

public ObjectFieldPredicate()

ObjectFieldPredicate

public ObjectFieldPredicate(java.lang.Class objectClass)

ObjectFieldPredicate

public ObjectFieldPredicate(java.lang.String field,
                            java.lang.Object value)

ObjectFieldPredicate

public ObjectFieldPredicate(java.lang.Class objectClass,
                            java.lang.String field,
                            java.lang.Object value)
Method Detail

getObjectClass

public java.lang.Class getObjectClass()
Returns the class for this predicate.


setObjectClass

public void setObjectClass(java.lang.Class c)
Sets the class for this predicate.


getFieldName

public java.lang.String getFieldName()
Returns the field name for this predicate.


setFieldName

public void setFieldName(java.lang.String field)
Sets the field name for this predicate.


getValue

public java.lang.Object getValue()
Returns the value associated with the field of this predicate.


setValue

public void setValue(java.lang.Object value)
Sets the value associated with the field of this predicate.


evaluate

public boolean evaluate(java.lang.Object node)
Returns true if the specified node is of type objectClass and/or its value matches that which is define in the value and >code>field members.
Evaluation happens as follows:

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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