Loading...
Searching...
No Matches
BinaryComparisonOp.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/fe/BinaryComparisonOp.h
22
23 \brief A class for binary comparison operators.
24 */
25
26#ifndef __TERRALIB_FE_INTERNAL_BINARYCOMPARISONOP_H
27#define __TERRALIB_FE_INTERNAL_BINARYCOMPARISONOP_H
28
29// TerraLib
30#include "ComparisonOp.h"
31
32namespace te
33{
34 namespace fe
35 {
36// Forward declarations
37 class Expression;
38
39 /*!
40 \class BinaryComparisonOp
41
42 \brief A class for binary comparison operators
43
44 The Common Catalog Query Language defines a standard
45 set of comparison operators (=, <, >, >=, <=, <>). These
46 comparison operators are encoded using the complex
47 type BinaryComparisonOp. This type definition includes
48 the matchCase attribute which is Boolean type
49 and controls whether string comparisons are
50 case sensitive or not. A true value means that string
51 comparisons are case sensitive. This is the default value.
52 A false value means that string comparisons are
53 case insensitive.<br>
54 The following operators are defined in the Filter
55 Encoding specification:
56 <ul>
57 <li>PropertyIsEqualTo</li>
58 <li>PropertyIsPropertyIsNotEqualTo</li>
59 <li>PropertyIsPropertyIsLessThan</li>
60 <li>PropertyIsPropertyIsGreaterThan</li>
61 <li>PropertyIsPropertyIsLessThanOrEqualTo</li>
62 <li>PropertyIsPropertyIsGreaterThanOrEqualTo</li>
63 </ul>
64
65 \ingroup fe
66
67 \sa ComparisonOp, Expression
68 */
70 {
71 public:
72
74
75 /** @name Initializer Methods
76 * Methods related to instantiation and destruction.
77 */
78 //@{
79
80 /*!
81 \brief It initializes a new BinaryComparisonOp.
82
83 \param opName The comparison operator name.
84
85 \note The BinaryComparisonOp will not take the ownership of the given name.
86 */
87 BinaryComparisonOp(const char* opName = 0);
88
89 /*!
90 \brief It initializes a new BinaryComparisonOp.
91
92 \param opName The BinaryComparisonOp operator name.
93 \param f The first expression. The BinaryComparisonOp will take the ownership of the given expression.
94 \param s The second expression. The BinaryComparisonOp will take the ownership of the given expression.
95
96 \note The BinaryComparisonOp will not take the ownership of the given name.
97 */
98 BinaryComparisonOp(const char* opName, Expression* f, Expression* s);
99
100 /*! \brief Virtual destructor. */
102
103 //@}
104
105 /** @name Accessor methods
106 * Methods used to get or set properties.
107 */
108 //@{
109
110 /*!
111 \brief It sets the <i>first operand</i>.
112
113 \param first The <i>first operand</i>.
114
115 \note It will take the ownership of the <i>first operand</i>.
116 */
117 void setFirst(Expression* first);
118
119 /*!
120 \brief It returns the <i>first operand</i>.
121
122 \return The <i>first operand</i>.
123 */
125
126 /*!
127 \brief It sets the <i>second operand</i>.
128
129 \param second The <i>second operand</i>.
130
131 \note It will take the ownership of the <i>second operand</i>.
132 */
133 void setSecond(Expression* second);
134
135 /*!
136 \brief It returns the <i>second operand</i>.
137
138 \return The <i>second</i> operand.
139 */
141
142 /*!
143 \brief It enables the match case flag. So comparisons will be case sensitive.
144
145 \note This is the default state.
146 */
148
149 /*! \brief It disables the match case flag. So comparisons will not be case sensitive. */
151
152 /*! \brief It creates a new copy of this object. */
154
155 //@}
156
157 protected:
158
159 Expression* m_first; //!< first operand (mandatory).
160 Expression* m_second; //!< second operand (mandatory).
161 bool m_matchCase; //!< Optional (default: true).
162 };
163
164 } // end namespace fe
165} // end namespace te
166
167#endif // __TERRALIB_FE_INTERNAL_BINARYCOMPARISONOP_H
168
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
A class for binary comparison operators.
Expression * getFirst() const
It returns the first operand.
BinaryComparisonOp(const char *opName, Expression *f, Expression *s)
It initializes a new BinaryComparisonOp.
Expression * m_second
second operand (mandatory).
virtual ~BinaryComparisonOp()
Virtual destructor.
void enableMatchCase()
It enables the match case flag. So comparisons will be case sensitive.
Expression * getSecond() const
It returns the second operand.
Expression * m_first
first operand (mandatory).
void setFirst(Expression *first)
It sets the first operand.
ComparisonOp * clone() const
It creates a new copy of this object.
bool m_matchCase
Optional (default: true).
BinaryComparisonOp(const char *opName=0)
It initializes a new BinaryComparisonOp.
void disableMatchCase()
It disables the match case flag. So comparisons will not be case sensitive.
void setSecond(Expression *second)
It sets the second operand.
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:50
This is an abstract class that models a Filter Encoding expression.
Definition: Expression.h:51
TerraLib.
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59