|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.graph.FieldComparePredicate
public class FieldComparePredicate
Predicate which compares field values of the specified
field against the specified value.
Class evaluation limiting may be achieved by specifying the
metaClass
or metaClassName
properties.
Field Summary | |
---|---|
static int |
EQUALS
Public constants of available operations. |
static int |
GREATER_THAN
|
static int |
GREATER_THAN_EQUAL_TO
|
static int |
LESS_THAN
|
static int |
LESS_THAN_EQUAL_TO
|
static int |
MATCHES
|
static int |
NOT_EQUALS
|
Constructor Summary | |
---|---|
FieldComparePredicate()
|
|
FieldComparePredicate(MetaClass metaClass)
Constructor to create a MateObjectPredicate from a MetaClass . |
|
FieldComparePredicate(MetaClass metaClass,
java.lang.String field,
java.lang.Object value)
Constructor to create a MateObjectPredicate from a MetaClass ,
field and value. |
|
FieldComparePredicate(java.lang.String metaClassName,
java.lang.String field,
java.lang.Object value)
Constructor to create a MateObjectPredicate from a meta class name, field and value. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
boolean |
evaluate(java.lang.Object obj)
Returns true if the specified node is a meta-object with the correct field value. |
java.lang.String |
getFieldName()
Returns the field name for which we are checking. |
MetaClass |
getMetaClass()
Returns the meta-class for which we are searching. |
java.lang.String |
getMetaClassName()
Returns the meta-class name for which we are searching. |
int |
getOperation()
Gets the operation used for this evaluation. |
java.lang.Object |
getValue()
Returns the value for which we are looking. |
int |
hashCode()
|
void |
setFieldName(java.lang.String field)
Sets the field name for this predicate. |
void |
setMetaClass(MetaClass metaClass)
Sets the meta-class to be searched later. |
void |
setMetaClassName(java.lang.String metaClassName)
Sets the metaClassName for this predicate. |
void |
setOperation(int op)
Set the operation used in the evaluation |
void |
setValue(java.lang.Object value)
Sets the value assocaited 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 |
Field Detail |
---|
public static final int EQUALS
public static final int NOT_EQUALS
public static final int LESS_THAN
public static final int LESS_THAN_EQUAL_TO
public static final int GREATER_THAN
public static final int GREATER_THAN_EQUAL_TO
public static final int MATCHES
Constructor Detail |
---|
public FieldComparePredicate()
public FieldComparePredicate(MetaClass metaClass)
MetaClass
.
public FieldComparePredicate(java.lang.String metaClassName, java.lang.String field, java.lang.Object value)
public FieldComparePredicate(MetaClass metaClass, java.lang.String field, java.lang.Object value)
MetaClass
,
field and value.
Method Detail |
---|
public MetaClass getMetaClass()
public void setMetaClass(MetaClass metaClass)
public java.lang.String getMetaClassName()
public void setMetaClassName(java.lang.String metaClassName)
public java.lang.String getFieldName()
public void setFieldName(java.lang.String field)
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
public void setOperation(int op)
public int getOperation()
public boolean evaluate(java.lang.Object obj)
metaClass
:
If this is set, the object will
be evaluated on the basis that it is
an instance of the metaClass
type.
metaClassName
:
If this is set, the object will
be evaluated on the basis that it is
an instance of the meta class as looked up
through the object's class registry.
metaClass
and metaClassName
are mutually exclusive.
field
:
Required - The field to be checked, and provided
the object to be evaluated has this property, the data contained
in value
will be used as a final determinent of the evaluation.
null
is considered valid data
in the value
.
evaluate
in interface org.apache.commons.collections.Predicate
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |