indexing
description: "COM Currency Structure"
status: "See notice at end of class"
date: "$Date$"
revision: "$Revision$"
class interface
ECOM_CURRENCY
create
make
make_from_pointer (a_pointer: POINTER)
require ECOM_STRUCTURE
valid_pointer: a_pointer /= default_pointer
make_from_decimal (dec_value: ECOM_DECIMAL)
feature
make
make_from_decimal (dec_value: ECOM_DECIMAL)
feature
high_bits: INTEGER
item: POINTER
WEL_ANY
low_bits: INTEGER
one: ECOM_CURRENCY
*
ensure NUMERIC
result_exists: Result /= void
zero: ECOM_CURRENCY
+
ensure NUMERIC
result_exists: Result /= void
feature
structure_size: INTEGER
ensure WEL_STRUCTURE
positive_result: Result > 0
feature
exists: BOOLEAN
item
WEL_ANY
ensure WEL_ANY
Result = (item /= default_pointer)
shared: BOOLEAN
item
item
destroy_item
item
WEL_ANY
feature
set_shared
shared
WEL_ANY
ensure WEL_ANY
shared: shared
set_unshared
shared
WEL_ANY
ensure WEL_ANY
unshared: not shared
feature
dispose
Current
Current
WEL_ANY
feature
absolute: ECOM_CURRENCY
ensure
valid_result: Result /= void
ceiled_integer_portion: ECOM_CURRENCY
ensure
valid_result: Result /= void
rounded (value: INTEGER): ECOM_CURRENCY
value
require
valid_value: value >= 0
ensure
valid_result: Result /= void
to_integer: INTEGER
item
WEL_ANY
ensure WEL_ANY
Result = cwel_pointer_to_integer (item)
truncated_to_double: DOUBLE
DOUBLE
require
valid_item: item /= default_pointer
truncated_to_integer_portion: ECOM_CURRENCY
ensure
valid_result: Result /= void
feature
initialize
WEL_STRUCTURE
require WEL_STRUCTURE
exists: exists
initialize_with_character (a_character: CHARACTER)
a_character
WEL_STRUCTURE
require WEL_STRUCTURE
exists: exists
memory_copy (source_pointer: POINTER; length: INTEGER)
lengthsource_pointeritem
WEL_STRUCTURE
require WEL_STRUCTURE
length_small_enough: length <= structure_size
length_large_enough: length > 0
exists: exists
multiply_integer (an_integer: INTEGER): ECOM_CURRENCY
an_integer
ensure
valid_result: Result /= void
infix "*" (other: ECOM_CURRENCY): ECOM_CURRENCY
other
require NUMERIC
other_exists: other /= void
ensure NUMERIC
result_exists: Result /= void
infix "+" (other: ECOM_CURRENCY): ECOM_CURRENCY
other
require NUMERIC
other_exists: other /= void
ensure NUMERIC
result_exists: Result /= void
commutative: equal (Result, other + Current)
prefix "+": ECOM_CURRENCY
ensure NUMERIC
result_exists: Result /= void
infix "-" (other: ECOM_CURRENCY): ECOM_CURRENCY
other
require NUMERIC
other_exists: other /= void
ensure NUMERIC
result_exists: Result /= void
prefix "-": ECOM_CURRENCY
ensure NUMERIC
result_exists: Result /= void
infix "/" (other: ECOM_CURRENCY): ECOM_CURRENCY
require NUMERIC
other_exists: other /= void
good_divisor: divisible (other)
ensure NUMERIC
result_exists: Result /= void
infix "^" (other: NUMERIC): NUMERIC
feature
set_value (source: like Current)
ECOM_STRUCTURE
require ECOM_STRUCTURE
non_void: source /= void
valid_source: source.item /= default_pointer
feature
set_high_bits (an_integer: INTEGER)
high_bitsan_integer
ensure
high_bits_set: high_bits = an_integer
set_low_bits (an_integer: INTEGER)
ensure
low_bits_set: low_bits = an_integer
feature
divisible (other: ECOM_CURRENCY): BOOLEAN
other
require NUMERIC
other_exists: other /= void
exponentiable (other: ECOM_CURRENCY): BOOLEAN
other
require NUMERIC
other_exists: other /= void
is_equal (other: like Current): BOOLEAN
require ANY
other_not_void: other /= void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
invariant
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
end -- ECOM_CURRENCY