indexing
description: "Container for transactions"
status: "See note at end of class"
date: "$Date$"
revision: "$Revision$"
deferred class interface
TRANSACTION_CONTAINER [G -> TRANSACTION]
feature
has (v: like item): BOOLEAN
v
object_comparison
LINEAR
ensure CONTAINER
not_found_in_empty: Result implies not is_empty
index: INTEGER
index_of (v: like item; i: INTEGER): INTEGER
iv
object_comparison
LINEAR
require LINEAR
positive_occurrences: i > 0
ensure LINEAR
non_negative_result: Result >= 0
item: G
TRAVERSABLE
require TRAVERSABLE
not_off: not off
require ACTIVE
readable: readable
occurrences (v: G): INTEGER
v
object_comparison
LINEAR
ensure BAG
non_negative_occurrences: Result >= 0
off: BOOLEAN
BILINEAR
transaction: G
feature
count: INTEGER
feature
after: BOOLEAN
LINEAR
changeable_comparison_criterion: BOOLEAN
object_comparison
CONTAINER
error_stops: BOOLEAN
exhausted: BOOLEAN
LINEAR
ensure LINEAR
exhausted_when_off: off implies Result
extendible: BOOLEAN
COLLECTION
full: BOOLEAN
BOX
insertable (t: G): BOOLEAN
t
require
transaction_exists: t /= void
is_empty: BOOLEAN
FINITE
is_inserted (v: G): BOOLEAN
v
COLLECTION
object_comparison: BOOLEAN
equal=
=
CONTAINER
prunable: BOOLEAN
COLLECTION
readable: BOOLEAN
SEQUENCE
writable: BOOLEAN
SEQUENCE
feature
compare_objects
equal
=
CONTAINER
require CONTAINER
changeable_comparison_criterion
ensure CONTAINER
object_comparison
compare_references
=
equal
CONTAINER
require CONTAINER
changeable_comparison_criterion
ensure CONTAINER
reference_comparison: not object_comparison
continue_on_error
ensure
does_not_stop: not error_stops
select_transaction (n: INTEGER)
n
require
not_empty: not is_empty
index_in_range: 1 <= n and n <= count
ensure
selected: index = n
stop_on_error
ensure
stop: error_stops
feature
back
BILINEAR
require BILINEAR
not_before: not before
before: BOOLEAN
BILINEAR
finish
LINEAR
forth
exhausted
LINEAR
require LINEAR
not_after: not after
search (v: like item)
itemv
v
exhausted
object_comparison
BILINEAR
ensure LINEAR
object_found: (not exhausted and object_comparison) implies equal (v, item)
item_found: (not exhausted and not object_comparison) implies v = item
start
TRAVERSABLE
feature
add_transaction (t: G)
require
transaction_exists: t /= void
transaction_correct: t.is_correct
ensure
one_more_item: count = old count + 1
index_unchanged: not old is_empty implies index = old index
append (s: SEQUENCE [G])
s
SEQUENCE
require SEQUENCE
argument_not_void: s /= void
ensure SEQUENCE
new_count: count >= old count
extend (v: G)
v
BAG
require COLLECTION
extendible: extendible
ensure COLLECTION
item_inserted: is_inserted (v)
ensure then BAG
one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
fill (other: CONTAINER [G])
other
other
COLLECTION
require COLLECTION
other_not_void: other /= void
extendible
force (v: like item)
v
SEQUENCE
require SEQUENCE
extendible: extendible
ensure then SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)
put (v: like item)
v
SEQUENCE
require COLLECTION
extendible: extendible
ensure COLLECTION
item_inserted: is_inserted (v)
ensure then SEQUENCE
new_count: count = old count + 1
replace (v: G)
v
ACTIVE
require ACTIVE
writable: writable
ensure ACTIVE
item_replaced: item = v
feature
prune (v: like item)
v
off
SEQUENCE
require COLLECTION
prunable: prunable
prune_all (v: like item)
voff
SEQUENCE
require COLLECTION
prunable
ensure COLLECTION
no_more_occurrences: not has (v)
remove
ACTIVE
require ACTIVE
prunable: prunable
writable: writable
wipe_out
COLLECTION
require COLLECTION
prunable
ensure COLLECTION
wiped_out: is_empty
feature
linear_representation: LINEAR [G]
LINEAR
feature
do_all (action: PROCEDURE [ANY, TUPLE [G]])
action
action
LINEAR
require TRAVERSABLE
action_exists: action /= void
do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
actiontest
actiontest
LINEAR
require TRAVERSABLE
action_exists: action /= void
test_exits: test /= void
for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
test
LINEAR
require TRAVERSABLE
test_exits: test /= void
there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
test
LINEAR
require TRAVERSABLE
test_exits: test /= void
invariant
empty_definition: is_empty = (count = 0)
index_in_range: not is_empty implies (1 <= index and index <= count)
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies (not readable) and (not writable)
BILINEAR
not_both: not (after and before)
before_constraint: before implies off
LINEAR
after_constraint: after implies off
TRAVERSABLE
empty_constraint: is_empty implies off
FINITE
empty_definition: is_empty = (count = 0)
non_negative_count: count >= 0
end -- TRANSACTION_CONTAINER