PropertyIsBetween.cpp
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 PropertyIsBetween.cpp
22 
23  \brief The PropertyIsBetween element is defined as a compact way of encoding a range check.
24  */
25 
26 // TerraLib
27 #include "Expression.h"
28 #include "Globals.h"
29 #include "PropertyIsBetween.h"
30 
32  : ComparisonOp(Globals::sm_propertyIsBetween),
33  m_expression(nullptr),
34  m_lowerBoundary(nullptr),
35  m_upperBoundary(nullptr)
36 {
37 }
38 
40 {
41  delete m_expression;
42  delete m_lowerBoundary;
43  delete m_upperBoundary;
44 }
45 
47 {
48  delete m_expression;
49  m_expression = e;
50 }
51 
53 {
54  return m_expression;
55 }
56 
58 {
59  delete m_lowerBoundary;
60  m_lowerBoundary = e;
61 }
62 
64 {
65  return m_lowerBoundary;
66 }
67 
69 {
70  delete m_upperBoundary;
71  m_upperBoundary = e;
72 }
73 
75 {
76  return m_upperBoundary;
77 }
78 
80 {
81  PropertyIsBetween *propIsBetween = new PropertyIsBetween;
82 
83  if(m_name)
84  propIsBetween->setName(m_name);
85 
86  if(m_expression)
87  propIsBetween->setExpression(m_expression->clone());
88 
89  if(m_lowerBoundary)
90  propIsBetween->setLowerBoundary(m_lowerBoundary->clone());
91 
92  if(m_upperBoundary)
93  propIsBetween->setLowerBoundary(m_upperBoundary->clone());
94 
95  return propIsBetween;
96 }
ComparisonOp * clone() const
It creates a new copy of this object.
void setLowerBoundary(Expression *e)
It sets the lower boundary expression.
void setName(const char *opName)
It sets the operator name.
Definition: AbstractOp.h:89
The PropertyIsBetween element is defined as a compact way of encoding a range check.
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:49
An static class with global definitions.
PropertyIsBetween()
It initializes a new PropertyIsBetween.
void setExpression(Expression *e)
It sets the between expression.
Expression * getUpperBoundary() const
It returns the upper boundary expression.
virtual Expression * clone() const =0
It returns a clone of this object.
This is an abstract class that models a Filter Encoding expression.
Definition: fe/Expression.h:50
An static class with global definitions.
This is an abstract class that models a Filter Encoding expression.
Expression * m_lowerBoundary
Mandatory.
Expression * m_upperBoundary
Mandatory.
The PropertyIsBetween element is defined as a compact way of encoding a range check.
void setUpperBoundary(Expression *e)
It sets the lower boundary expression.
Expression * m_expression
Mandatory.
const char * m_name
Operator name.
Definition: AbstractOp.h:123
Expression * getLowerBoundary() const
It returns the lower boundary expression.
Expression * getExpression() const
It returns the between expression.