src/include/common/filter/LogicalClause.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol, Inc
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00016  * 02111-1307  USA
00017  */
00018 #ifndef INCL_LOGICALCLAUSE
00019 #define INCL_LOGICALCLAUSE
00020 
00022 #include "base/util/ArrayList.h"
00023 #include "filter/Clause.h"
00024 
00025 typedef enum {
00026     NOT = 0,
00027     AND = 1,
00028     OR  = 2
00029 } LogicalClauseOperator;
00030 
00031 class LogicalClause : public Clause {
00032 
00033     // ------------------------------------------------------- Private interface
00034 private:
00035 
00036     LogicalClauseOperator op;
00037     ArrayList* operands;
00038 
00039 
00040 
00041     // ----------------------------------------------------- Protected interface
00042 protected:
00043     /*
00044      * LogicalClause constructor
00045      *
00046      */
00047     LogicalClause();
00048 
00049 
00050 
00051     // -------------------------------------------------------- Public interface
00052 public:
00053 
00054     ~LogicalClause();
00055 
00056 
00057     /*
00058      * LogicalClause constructor
00059      *
00060      * @param o the logical operator
00061      * @param ops the operands ArrayList
00062      * @param n how many operands are passed in ops
00063      */
00064     LogicalClause(LogicalClauseOperator o, ArrayList& ops);
00065 
00066     /*
00067      * getOperator
00068      *
00069      */
00070     LogicalClauseOperator getOperator();
00071 
00072 
00073     /*
00074      * setOperator
00075      *
00076      * @param p0
00077      */
00078     void setOperator(LogicalClauseOperator p0);
00079 
00080 
00081     /*
00082      * getOperands
00083      *
00084      */
00085     ArrayList* getOperands();
00086 
00087 
00088     /*
00089      * setOperands
00090      *
00091      * @param ops the operands ArrayList
00092     */
00093     void setOperands(ArrayList& ops);
00094 
00095 
00096     /*
00097      * isUnaryOperator
00098      *
00099      */
00100     BOOL isUnaryOperator();
00101 
00102     /*
00103      * Creates a new instance of this Clause
00104      *
00105      * @return the clone
00106      */
00107     ArrayElement* clone();
00108 
00109 
00110 };
00111 
00112 
00114 #endif

Generated on Fri Nov 9 12:21:24 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2