home
wiki
classes/clusters list
class information
+
Point of view
ANY
ANY
INTERNALS_HANDLER
All features
expanded class CHARACTER
Summary
top
Note: An Eiffel
CHARACTER
is mapped as a C unsigned char or as a Java Byte.
Direct parents
insert list:
COMPARABLE
,
HASHABLE
,
PLATFORM
Overview
top
exported features
code
:
INTEGER_16
ASCII code of Current.
to_integer_8
:
INTEGER_8
Sign-extended conversion.
to_integer
:
INTEGER_8
infix "<"
(other: CHARACTER):
BOOLEAN
Comparison using
code
.
infix "<="
(other: CHARACTER):
BOOLEAN
Comparison using
code
.
infix ">"
(other: CHARACTER):
BOOLEAN
Comparison using
code
.
infix ">="
(other: CHARACTER):
BOOLEAN
Comparison using
code
.
value
:
INTEGER_8
Gives the value of a decimal digit.
decimal_value
:
INTEGER_8
Gives the value of a decimal digit.
binary_value
:
INTEGER_8
Gives the value of a binary digit.
octal_value
:
INTEGER_8
Gives the value of an octal digit.
hexadecimal_value
:
INTEGER_8
Gives the value of an hexadecimal digit.
same_as
(other: CHARACTER):
BOOLEAN
Case insensitive comparison.
to_upper
: CHARACTER
Conversion to the corresponding upper case.
to_lower
: CHARACTER
Conversion to the corresponding lower case.
is_letter
:
BOOLEAN
Is it a letter (
'a'
..
'z'
or
'A'
..
'Z'
) ?
is_digit
:
BOOLEAN
Belongs to
'0'
..'
is_decimal_digit
:
BOOLEAN
Belongs to
'0'
..'
is_binary_digit
:
BOOLEAN
Belongs to
'0'
..'
is_octal_digit
:
BOOLEAN
Belongs to
'0'
..'
is_hexadecimal_digit
:
BOOLEAN
Is it one character of
"0123456789abcdefABCDEF"
?
is_lower
:
BOOLEAN
Is it some lowercase letter (
'a'
..
'z'
)?
is_upper
:
BOOLEAN
Is it some uppercase letter (
'A'
..
'Z'
)?
is_separator
:
BOOLEAN
True when character is a separator.
is_letter_or_digit
:
BOOLEAN
Is it a letter (see
is_letter
) or a digit (see
is_digit
) ?
is_ascii
:
BOOLEAN
Is character a 8-bit ASCII character?
is_bit
:
BOOLEAN
True for
0
and
1
.
next
: CHARACTER
Give the next character (the following
code
)
previous
: CHARACTER
Give the previous character (the
code
before)
Conversions:
to_hexadecimal
:
STRING
Create a new
STRING
giving the
code
in hexadecimal.
to_hexadecimal_in
(str:
STRING
)
Append the equivalent of
to_hexadecimal
at the end of
str
.
to_string
:
STRING
Object Printing:
out_in_tagged_out_memory
Append terse printable represention of current object in
tagged_out_memory
.
fill_tagged_out_memory
Append a viewable information in
tagged_out_memory
in order to affect the behavior of
out
,
tagged_out
, etc.
Hashing:
hash_code
:
INTEGER_32
The hash-code value of
Current
.
Miscellaneous:
is_alpha
:
BOOLEAN
See
is_letter
(yes this is just a call to
is_letter
).
is_equal
(other: CHARACTER):
BOOLEAN
Is
other
attached to an object considered equal to current object?
in_range
(lower: CHARACTER, upper: CHARACTER):
BOOLEAN
Return True if
Current
is in range [
lower
..
upper
]
See also
min
,
max
,
compare
.
compare
(other: CHARACTER):
INTEGER_32
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
three_way_comparison
(other: CHARACTER):
INTEGER_32
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
min
(other: CHARACTER): CHARACTER
Minimum of
Current
and
other
.
max
(other: CHARACTER): CHARACTER
Maximum of
Current
and
other
.
code
:
INTEGER_16
top
ASCII code of Current.
(No Sign-extended conversion.)
See also
to_integer_8
.
to_integer_8
:
INTEGER_8
top
Sign-extended conversion.
See also
code
.
to_integer
:
INTEGER_8
effective function
top
This feature is obsolete:
Now use `to_integer_8' instead (march 2006).
infix "<"
(other: CHARACTER):
BOOLEAN
effective function
top
Comparison using
code
.
require
other_exists:
other /= Void
ensure
Result =
code
< other.
code
asymmetric:
Result implies not other < Current
infix "<="
(other: CHARACTER):
BOOLEAN
effective function
top
Comparison using
code
.
require
other_exists:
other /= Void
ensure
definition:
Result = Current < other or is_equal(other)
infix ">"
(other: CHARACTER):
BOOLEAN
effective function
top
Comparison using
code
.
require
other_exists:
other /= Void
ensure
definition:
Result = other < Current
infix ">="
(other: CHARACTER):
BOOLEAN
effective function
top
Comparison using
code
.
require
other_exists:
other /= Void
ensure
definition:
Result = other <= Current
value
:
INTEGER_8
effective function
top
Gives the value of a decimal digit.
require
is_digit
ensure
Result.in_range(0, 9)
decimal_value
:
INTEGER_8
effective function
top
Gives the value of a decimal digit.
require
is_digit
ensure
Result.in_range(0, 9)
binary_value
:
INTEGER_8
effective function
top
Gives the value of a binary digit.
require
is_binary_digit
ensure
Result.in_range(0, 1)
octal_value
:
INTEGER_8
effective function
top
Gives the value of an octal digit.
require
is_octal_digit
ensure
Result.in_range(0, 7)
hexadecimal_value
:
INTEGER_8
effective function
top
Gives the value of an hexadecimal digit.
require
is_hexadecimal_digit
ensure
Result.in_range(0, 15)
same_as
(other: CHARACTER):
BOOLEAN
effective function
top
Case insensitive comparison.
No difference between upper/lower case letters.
ensure
Result implies
to_lower
= other or
to_upper
= other
to_upper
: CHARACTER
effective function
top
Conversion to the corresponding upper case.
to_lower
: CHARACTER
effective function
top
Conversion to the corresponding lower case.
is_letter
:
BOOLEAN
effective function
top
Is it a letter (
'a'
..
'z'
or
'A'
..
'Z'
) ?
ensure
Result =
in_range
('A', 'Z') or
in_range
('a', 'z')
is_digit
:
BOOLEAN
effective function
top
Belongs to
'0'
..'
9'.
See also
value
,
decimal_value
ensure
Result =
in_range
('0', '9')
is_decimal_digit
:
BOOLEAN
effective function
top
Belongs to
'0'
..'
9'.
See also
value
,
decimal_value
ensure
Result =
in_range
('0', '9')
is_binary_digit
:
BOOLEAN
effective function
top
Belongs to
'0'
..'
1'.
ensure
Result =
in_range
('0', '1')
is_octal_digit
:
BOOLEAN
effective function
top
Belongs to
'0'
..'
7'.
ensure
Result =
in_range
('0', '7')
is_hexadecimal_digit
:
BOOLEAN
effective function
top
Is it one character of
"0123456789abcdefABCDEF"
?
ensure
Result = "0123456789abcdefABCDEF".has(Current)
is_lower
:
BOOLEAN
effective function
top
Is it some lowercase letter (
'a'
..
'z'
)?
is_upper
:
BOOLEAN
effective function
top
Is it some uppercase letter (
'A'
..
'Z'
)?
is_separator
:
BOOLEAN
effective function
top
True when character is a separator.
is_letter_or_digit
:
BOOLEAN
effective function
top
Is it a letter (see
is_letter
) or a digit (see
is_digit
) ?
ensure
definition:
Result =
is_letter
or
is_digit
is_ascii
:
BOOLEAN
effective function
top
Is character a 8-bit ASCII character?
is_bit
:
BOOLEAN
effective function
top
True for
0
and
1
.
next
: CHARACTER
effective function
top
Give the next character (the following
code
)
previous
: CHARACTER
effective function
top
Give the previous character (the
code
before)
to_hexadecimal
:
STRING
effective function
top
Create a new
STRING
giving the
code
in hexadecimal.
For example :
(255).to_character.to_hexadecimal gives
"FF"
. Note: see
to_hexadecimal_in
to save memory.
ensure
Result.count = 2
to_hexadecimal_in
(str:
STRING
)
effective procedure
top
Append the equivalent of
to_hexadecimal
at the end of
str
.
Thus you can save memory because no other
STRING
is allocated for the job.
ensure
str.count = 2 + old str.count
to_string
:
STRING
effective function
top
ensure
Result.count = 1
Result.first = Current
out_in_tagged_out_memory
effective procedure
top
Append terse printable represention of current object in
tagged_out_memory
.
ensure
not_cleared:
tagged_out_memory.count >= old tagged_out_memory.count
append_only:
old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
fill_tagged_out_memory
effective procedure
top
Append a viewable information in
tagged_out_memory
in order to affect the behavior of
out
,
tagged_out
, etc.
hash_code
:
INTEGER_32
effective function
top
The hash-code value of
Current
.
ensure
good_hash_value:
Result >= 0
is_alpha
:
BOOLEAN
effective function
top
See
is_letter
(yes this is just a call to
is_letter
).
Isn't
is_letter
better English ;-)
ensure
Result =
is_letter
is_equal
(other: CHARACTER):
BOOLEAN
deferred function
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
Result implies
hash_code
= other.
hash_code
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
in_range
(lower: CHARACTER, upper: CHARACTER):
BOOLEAN
effective function
top
Return True if
Current
is in range [
lower
..
upper
]
See also
min
,
max
,
compare
.
ensure
Result = Current
>=
lower and Current
<=
upper
compare
(other: CHARACTER):
INTEGER_32
effective function
top
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
See also
min
,
max
,
in_range
.
require
other_exists:
other /= Void
ensure
equal_zero:
Result = 0 =
is_equal
(other)
smaller_negative:
Result = -1 = Current
<
other
greater_positive:
Result = 1 = Current
>
other
three_way_comparison
(other: CHARACTER):
INTEGER_32
effective function
top
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
See also
min
,
max
,
in_range
.
require
other_exists:
other /= Void
ensure
equal_zero:
Result = 0 =
is_equal
(other)
smaller_negative:
Result = -1 = Current
<
other
greater_positive:
Result = 1 = Current
>
other
min
(other: CHARACTER): CHARACTER
effective function
top
Minimum of
Current
and
other
.
See also
max
,
in_range
.
require
other /= Void
ensure
Result
<=
Current and then Result
<=
other
compare
(Result) = 0 or else other.
compare
(Result) = 0
max
(other: CHARACTER): CHARACTER
effective function
top
Maximum of
Current
and
other
.
See also
min
,
in_range
.
require
other /= Void
ensure
Result
>=
Current and then Result
>=
other
compare
(Result) = 0 or else other.
compare
(Result) = 0