activemq-cpp-3.9.5
Boolean.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _DECAF_LANG_BOOLEAN_H_
19#define _DECAF_LANG_BOOLEAN_H_
20
21#include <string>
22#include <decaf/lang/String.h>
24#include <decaf/util/Config.h>
25
26namespace decaf{
27namespace lang{
28
29 class DECAF_API Boolean : public Comparable<Boolean>,
30 public Comparable<bool> {
31 private:
32
33 // This objects boolean value
34 bool value;
35
36 public:
37
41 static const Boolean _FALSE;
42
46 static const Boolean _TRUE;
47
48 public:
49
53 Boolean(bool value);
54
58 Boolean(const String& value);
59
60 virtual ~Boolean() {}
61
65 bool booleanValue() const {
66 return value;
67 }
68
72 std::string toString() const;
73
82 virtual int compareTo(const Boolean& b) const;
83
89 virtual bool operator==(const Boolean& value) const;
90
97 virtual bool operator<(const Boolean& value) const;
98
102 bool equals(const Boolean& b) const {
103 return this->value == b.value;
104 }
105
114 virtual int compareTo(const bool& b) const;
115
121 virtual bool operator==(const bool& value) const;
122
129 virtual bool operator<(const bool& value) const;
130
134 bool equals(const bool& b) const {
135 return this->value == b;
136 }
137
138 public:
139
146 static Boolean valueOf(bool value);
147
154 static Boolean valueOf(const String& value);
155
163 static bool parseBoolean(const String& value);
164
172 static std::string toString(bool value);
173
174 };
175
176}}
177
178#endif /*_DECAF_LANG_BOOLEAN_H_*/
virtual bool operator<(const Boolean &value) const
Compares this object to another and returns true if this object is considered to be less than the one...
virtual int compareTo(const bool &b) const
Compares this Boolean instance with another.
static Boolean valueOf(const String &value)
static const Boolean _FALSE
The Class object representing the primitive false boolean.
Definition Boolean.h:41
virtual bool operator<(const bool &value) const
Compares this object to another and returns true if this object is considered to be less than the one...
virtual int compareTo(const Boolean &b) const
Compares this Boolean instance with another.
Boolean(const String &value)
bool equals(const bool &b) const
Definition Boolean.h:134
static Boolean valueOf(bool value)
virtual bool operator==(const bool &value) const
Compares equality between this object and the one passed.
static std::string toString(bool value)
Converts the bool to a String representation.
bool booleanValue() const
Definition Boolean.h:65
static bool parseBoolean(const String &value)
Parses the String passed and extracts an bool.
bool equals(const Boolean &b) const
Definition Boolean.h:102
virtual ~Boolean()
Definition Boolean.h:60
static const Boolean _TRUE
The Class object representing the primitive type boolean.
Definition Boolean.h:46
virtual bool operator==(const Boolean &value) const
Compares equality between this object and the one passed.
std::string toString() const
This interface imposes a total ordering on the objects of each class that implements it.
Definition Comparable.h:33
An immutable sequence of characters.
Definition String.h:57
#define DECAF_API
Definition Config.h:29
Definition ThreadingTypes.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25