indexing
description: "Formatter for integral numbers"
legal: "See notice at end of class."
status: "See notice at end of class."
names: format_integer
date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
revision: "$Revision: 56675 $"
class interface
FORMAT_INTEGER
create
make (w: INTEGER_32)
require
reasonable_field: w >= 1
ensure
blank_fill: fill_character = ' '
show_sign_negative: show_sign_negative
no_separator: no_separator
width_set: width = w
right_justified: right_justified
leading_sign: leading_sign
feature
make (w: INTEGER_32)
require
reasonable_field: w >= 1
ensure
blank_fill: fill_character = ' '
show_sign_negative: show_sign_negative
no_separator: no_separator
width_set: width = w
right_justified: right_justified
leading_sign: leading_sign
feature
bracketted_negative: BOOLEAN
fill_character: CHARACTER_8
generating_type: STRING_8
ANY
generator: STRING_8
ANY
justification: INTEGER_32
separator: CHARACTER_8
sign_format: INTEGER_32
sign_string: STRING_8
trailing_sign: BOOLEAN
width: INTEGER_32
feature
frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
shallow_implies_deep: standard_equal (some, other) implies Result
both_or_none_void: (some = Void) implies (Result = (other = Void))
same_type: (Result and (some /= Void)) implies some.same_type (other)
symmetric: Result implies deep_equal (other, some)
frozen equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))
is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))
frozen standard_is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
same_type: Result implies same_type (other)
symmetric: Result implies other.standard_is_equal (Current)
feature
centered: BOOLEAN
ensure
Result = (justification = center_justification)
conforms_to (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ignore_sign: BOOLEAN
ensure
Result = (sign_format = ignore_sign_value)
leading_sign: BOOLEAN
ensure
Result = not trailing_sign
left_justified: BOOLEAN
ensure
Result = (justification = left_justification)
no_separator: BOOLEAN
ensure
Result = (separator = '%U')
not_justified: BOOLEAN
ensure
Result = (justification = no_justification)
right_justified: BOOLEAN
ensure
Result = (justification = right_justification)
same_type (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
definition: Result = (conforms_to (other) and other.conforms_to (Current))
show_sign: BOOLEAN
ensure
Result = (sign_format = show_sign_value)
show_sign_negative: BOOLEAN
ensure
Result = (sign_format = sign_negative_value)
show_sign_positive: BOOLEAN
ensure
Result = (sign_format = sign_positive_value)
feature
asterisk_fill
ensure
fill_character = '*'
blank_fill
ensure
fill_character = ' '
bracket_negative
ensure
bracketted_negative
center_justify
ensure
centered
comma_separate
ensure
separator = ','
dollar_fill
ensure
fill_character = '$'
dot_separate
ensure
separator = '.'
left_justify
ensure
left_justified
no_justify
ensure
not_justified
remove_separator
ensure
separator = '%U'
right_justify
ensure
right_justified
set_fill (c: CHARACTER_8)
`c'
ensure
fill_character = c
set_separator (c: CHARACTER_8)
`c'
ensure
separator = c
set_sign (s: STRING_8)
require
s /= Void
s.count >= 3
s.count \\ 3 = 0
ensure
sign_string.is_equal (s)
set_width (w: INTEGER_32)
`w'
require
wide_enough: w >= 1
ensure
width = w
sign_cr_dr
ensure
sign_string.is_equal ("CR DR")
sign_dr_cr
ensure
sign_string.is_equal ("DR CR")
sign_floating_dollar
ensure
sign_string.is_equal ("$$$")
sign_floating_dollar_signed
ensure
sign_string.is_equal ("-$ $+$")
sign_ignore
ensure
ignore_sign
sign_leading
ensure
leading_sign
sign_negative_only
ensure
show_sign_negative
sign_normal
ensure
sign_string.is_equal ("- +")
sign_positive_only
ensure
show_sign_positive
sign_show
ensure
show_sign
sign_trailing
ensure
trailing_sign
unbracket_negative
ensure
not bracketted_negative
underscore_separate
ensure
separator = '_'
zero_fill
ensure
fill_character = '0'
feature
formatted (i: INTEGER_32): STRING_8
ensure
exists: Result /= Void
correct_length: not_justified or Result.count >= width
feature
copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
frozen deep_copy (other: like Current)
copy`other'deep_twin
ANY
require ANY
other_not_void: other /= Void
ensure ANY
deep_equal: deep_equal (Current, other)
frozen deep_twin: like Current
ANY
ensure ANY
deep_equal: deep_equal (Current, Result)
frozen standard_copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_standard_equal: standard_is_equal (other)
frozen standard_twin: like Current
`other'
ANY
ensure ANY
standard_twin_not_void: Result /= Void
equal: standard_equal (Result, Current)
frozen twin: like Current
`Current'
twincopycopy
ANY
ensure ANY
twin_not_void: Result /= Void
is_equal: Result.is_equal (Current)
feature
frozen default: like Current
ANY
frozen default_pointer: POINTER
`POINTER'
`p'default
`p'`POINTER'
ANY
default_rescue
ANY
frozen do_nothing
ANY
feature
io: STD_FILES
ANY
out: STRING_8
ANYtagged_out
ANY
print (some: ANY)
`some'
ANY
frozen tagged_out: STRING_8
ANYout
ANY
feature
operating_environment: OPERATING_ENVIRONMENT
ANY
invariant
sign_string_constraint: sign_string /= Void
wide_enough: width >= 1
no_justification <= justification and justification <= right_justification
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
indexing
library: "EiffelBase: Library of reusable components for Eiffel."
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
356 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end FORMAT_INTEGER