#include <Integer.h>
|
static std::string | toString (int i, int radix) |
|
static std::string | toString (int i) |
|
static int | parseInt (const std::string &str, const int radix) |
|
static int | parseInt (const std::string &str, int radix, const bool decode) |
|
◆ Integer()
keyple::common::Integer::Integer |
( |
int |
value | ) |
|
|
inlineexplicit |
◆ parseInt() [1/2]
static int keyple::common::Integer::parseInt |
( |
const std::string & |
str, |
|
|
const int |
radix |
|
) |
| |
|
inlinestatic |
Converts the specified String
into an int
using the specified radix (base). The string must not be null
or empty. It may begin with an optional '-', which will negate the answer, provided that there are also valid digits. Each digit is parsed as if by Character.digit(d, radix)
, and must be in the range 0
to radix - 1
. Finally, the result must be within MIN_VALUE
to MAX_VALUE
, inclusive. Unlike Double.parseDouble, you may not have a leading '+'.
- Parameters
-
str | the String to convert |
radix | the radix (base) to use in the conversion |
- Returns
- the
String
argument converted to int
- Exceptions
-
NumberFormatException | if s cannot be parsed as an int |
◆ parseInt() [2/2]
static int keyple::common::Integer::parseInt |
( |
const std::string & |
str, |
|
|
int |
radix, |
|
|
const bool |
decode |
|
) |
| |
|
inlinestatic |
Helper for parsing ints, used by Integer, Short, and Byte.
- Parameters
-
str | the string to parse |
radix | the radix to use, must be 10 if decode is true |
decode | if called from decode |
- Returns
- the parsed int value
- Exceptions
-
NumberFormatException | if there is an error |
NullPointerException | if decode is true and str if null |
- See also
- parseInt()
-
decode()
-
parseByte()
-
parseShort()
◆ toString() [1/3]
std::string keyple::common::Integer::toString |
( |
| ) |
|
|
inline |
◆ toString() [2/3]
static std::string keyple::common::Integer::toString |
( |
int |
i | ) |
|
|
inlinestatic |
◆ toString() [3/3]
static std::string keyple::common::Integer::toString |
( |
int |
i, |
|
|
int |
radix |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following file: