org.imemex.predicates
Class AbstractPredicate

java.lang.Object
  extended by org.imemex.predicates.AbstractPredicate
All Implemented Interfaces:
Predicate
Direct Known Subclasses:
AttributeExistsPredicate, Equals, Greater, GreaterEqual, IDPredicate, IMAPFilteredFolderPullOperator.Changed, KeywordPredicate, Less, LessEqual, LogicalPattern.DummyPredicate, NotEquals, Regex

public abstract class AbstractPredicate
extends java.lang.Object
implements Predicate

Abstract predicate implementation which does the following:


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.imemex.predicates.Predicate
Predicate.PredType
 
Constructor Summary
AbstractPredicate()
           
AbstractPredicate(Predicate.PredType type, java.util.List<java.lang.String> variableNames)
           
AbstractPredicate(Predicate.PredType type, java.lang.String variable1)
           
AbstractPredicate(Predicate.PredType type, java.lang.String variable1, java.lang.String variable2)
           
 
Method Summary
 boolean equals(Predicate p, boolean deep)
          Compares this predicate to the given predicate p.
 Predicate.PredType getType()
          gets type of this predicate
 java.util.List<java.lang.String> getVariables()
          Gets all the variable names defined for the predicate.
 boolean renameVariable(java.lang.String oldName, java.lang.String newName, boolean suffix)
          renames a variable, if it exists
 java.lang.String toString()
           
 java.lang.String toXML()
          gets XML representation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.imemex.predicates.Predicate
copy, eval
 

Constructor Detail

AbstractPredicate

public AbstractPredicate(Predicate.PredType type,
                         java.util.List<java.lang.String> variableNames)

AbstractPredicate

public AbstractPredicate(Predicate.PredType type,
                         java.lang.String variable1)

AbstractPredicate

public AbstractPredicate(Predicate.PredType type,
                         java.lang.String variable1,
                         java.lang.String variable2)

AbstractPredicate

public AbstractPredicate()
Method Detail

getVariables

public final java.util.List<java.lang.String> getVariables()
Description copied from interface: Predicate
Gets all the variable names defined for the predicate.

Specified by:
getVariables in interface Predicate
Returns:
the variable names defined for the predicate.

getType

public Predicate.PredType getType()
Description copied from interface: Predicate
gets type of this predicate

Specified by:
getType in interface Predicate
Returns:

renameVariable

public boolean renameVariable(java.lang.String oldName,
                              java.lang.String newName,
                              boolean suffix)
Description copied from interface: Predicate
renames a variable, if it exists

Specified by:
renameVariable in interface Predicate
Parameters:
oldName - old variable name
newName - new variable name
suffix - true if suffix match should be used, false otherwise
Returns:
true if renamed, false otherwise

toString

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

toXML

public java.lang.String toXML()
Description copied from interface: Predicate
gets XML representation

Specified by:
toXML in interface Predicate
Returns:

equals

public boolean equals(Predicate p,
                      boolean deep)
Description copied from interface: Predicate
Compares this predicate to the given predicate p.

Specified by:
equals in interface Predicate
deep - true if type, variable names, and values have to match,
false if only type has to match.
Returns: