INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Reference class for CHARACTER."
project: "Eiffel Kernel Library"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: kernel
class CHARACTER_REF
inherit

HASHABLE
undefine
is_equal
redefine
out
end

COMPARABLE
redefine
out
end
feature -- Access

item: CHARACTER

code: INTEGER
-- Associated integer value

hash_code: INTEGER
-- Hash code value
-- (From HASHABLE)
feature -- Comparison

infix "<" (other: like Current): BOOLEAN
-- Is current character less than 'other'?
-- (From COMPARABLE)
feature -- Element change

set_item (c: CHARACTER)
-- Make 'c' the associated character value
ensure
item_set: item = c
feature -- Eiffel/S 1.3 compatibility

to_integer: INTEGER
obsolete "Eiffel/S 1.3 compatibility, use code"

from_integer (i: INTEGER)

to_lower: CHARACTER
obsolete "Eiffel/S 1.3 compatibility, use as_lower"
-- Lower case equivalent
ensure
definition: Result = as_lower

to_upper: CHARACTER
obsolete "Eiffel/S 1.3 compatibility, use as_upper"
-- Upper case equivalent
ensure
definition: Result = as_upper
feature -- Conversion

as_lower: CHARACTER
-- Lower case equivalent
ensure
converted: (ABCDEFGHIJKLMNOPQRSTUVWXYZ).has (item) implies Result = (abcdefghijklmnopqrstuvwxyz).item ((ABCDEFGHIJKLMNOPQRSTUVWXYZ).index_of (item, 1))
unchanged: not (ABCDEFGHIJKLMNOPQRSTUVWXYZ).has (item) implies Result = item

as_upper: CHARACTER
-- Upper case equivalent
ensure
converted: (abcdefghijklmnopqrstuvwxyz).has (item) implies Result = (ABCDEFGHIJKLMNOPQRSTUVWXYZ).item ((abcdefghijklmnopqrstuvwxyz).index_of (item, 1))
unchanged: not (abcdefghijklmnopqrstuvwxyz).has (item) implies Result = item
feature -- Output

out: STRING
-- Printable representation of character
-- (From GENERAL)

code_sequence: STRING
-- Printable representation of the character
-- replaced by the special character code when required
-- Examples:
-- code_sequence ('A') = "A" -- printed as A
-- code_sequence ('%B') = "%%B" -- printed as %B
-- code_sequence ('%A') = "@" -- printed as @
-- code_sequence ('%%') = "%%%%" -- printed as %%
-- code_sequence ('%"') = "%%%"" -- printed as %"
-- code_sequence ('%/130/') = "%%/130/" -- printed as %/130/
-- So, the output enclosed in quotes gives the original character
ensure
non_void_result: Result /= void
long_enough: Result.count >= 1
end -- class CHARACTER_REF

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES